github zio/zio v1.0.0-RC16
1.0.0-RC16

latest releases: v2.1.0-RC3, v2.1.0-RC2, v2.0.22...
4 years ago

Notable changes

ZIO

ZIO Stream

ZIO Test

In this release, the mocking framework API has gone through complete overhaul to be more concise and feature better type inference. Notable changes:

  • The capability tags for default mock services are moved directly to modules companion object. Use MockClock.nanoTime instead of MockClock.Service.nanoTime;
  • The expectations are now methods on capability tags. Use MockRandom.nextInt._0(equalTo(1)) returns value(42) instead of MockSpec.expect_(MockRandom.Service.nextInt._0)(equalTo(1))(42);
  • Assertions for input are now passed as arguments, e.g. MockConsole.putStrLn(equalTo("foo")) returns unit;
  • Stubbing returns is done via static methods value, valueF, valueM, failure, failureF, failureM, unit, and never in zio.test.mock.Expectation;
  • Dummy services (expecting no calls) are constructed using a static method nothing from zio.test.mock.Expectation. For example, val dummyConsole = Expectation.nothing[MockConsole];
  • The conversion to managed mock service is automatic and does not require any imports or type hints.

For more examples, see MockingExampleSpec.

Additional changes:

Don't miss a new zio release

NewReleases is sending notifications on new releases.