Releases: scalamock/scalamock
7.5.2
Bug fixes
- fix methods with generic HKT parameters by @goshacodes in #702
Dependency updates
- Update scala-library, scala-reflect to 2.13.17 by @scala-steward in #694
- Update zio, zio-test, zio-test-sbt to 2.1.22 by @scala-steward in #698
- Update sbt, scripted-plugin to 1.11.7 by @scala-steward in #692
- Update specs2-core to 4.23.0 by @scala-steward in #699
Full Changelog: v7.5.1...v7.5.2
7.5.1
7.5.0
New Features
🔥 ZIO Test support for Classic Scalamock by @evis in #665 featuring
- Easier migration path from zio-mock
- Ability to verify that effects were actually invoked.
- Safe mock creation via ZLayer
- Support for property-based testing
- Familiar scalamock syntax and clear error messages
This integration is already used in a large codebase and is considered production test ready
https://scalamock.org/classic/zio-test/
Bug Fixes
- Fix methods returning context functions by @goshacodes in #683
- not compile nullary with invalid values by @goshacodes in #686
Dependencies
- Update sbt, scripted-plugin to 1.11.6 by @scala-steward in #682
- Update sbt-scalajs, scalajs-compiler, ... to 1.20.1 by @scala-steward in #681
- Update zio, zio-test, zio-test-sbt to 2.1.21 by @scala-steward in #680
Full Changelog: v7.4.2...v7.5.0
7.4.2
Bug fixes
- not dealias type when stubbing it by @goshacodes in #679
- tuple arguments for scala 2 when providing them to 'impl' by @goshacodes in #678
Dependencies
- Update sbt, scripted-plugin to 1.11.4 by @scala-steward in #670
- Update cats-effect to 3.6.3 by @scala-steward in #667
- Update zio, zio-test, zio-test-sbt to 2.1.20 by @scala-steward in #666
- Update sbt, scripted-plugin to 1.11.5 by @scala-steward in #672
Full Changelog: v7.4.1...v7.4.2
7.4.1
What's Changed
- set result depending on call num by @goshacodes in #669
Full Changelog: v7.4.0...v7.4.1
v7.4.0
What's Changed
- replace StubbedMethod0[R] with StubbedMethod[Unit, R] by @goshacodes in #635
Full Changelog: v7.3.3...v7.4.0
7.3.3
What's Changed
-
Move context functions to MockContext by @steinybot in #632
-
fix by-name constructor arg mocking by @hughsimpson in #659
-
Update sbt-scalajs, scalajs-compiler, ... to 1.19.0 by @scala-steward in #631
-
Update zio, zio-test, zio-test-sbt to 2.1.19 by @scala-steward in #655
-
Update sbt, scripted-plugin to 1.11.2 by @scala-steward in #661
-
Update sbt-ci-release to 1.11.1 by @scala-steward in #657
New Contributors
- @steinybot made their first contribution in #632
Full Changelog: v7.3.2...v7.3.3
7.3.2
What's Changed
StubbedMethod0[R] will be replaced with StubbedMethod[Unit, R] to make model simpler and allow to generalize with different methods. To make it possible - we need to make its API similar.
Thats why:
returnsinStubbedMethod0is deprecated,returnsWithshould be used insteadreturnsZIOinStubbedZIOMethod0is deprecated,returnsZIOWithor other methods should be used insteadreturnsIOinStubbedIOMethod0is deprecated,returnsIOWithor other methods should be used instead
After 01.07.2025 new minor version will be published without StubbedMethod0 and deprecated methods will change their signatures to ones from StubbedMethod.
Full Changelog: v7.3.1...v7.3.2
7.3.1
What's Changed
Added not implemented method description to NotImplementedError. Now you will also see failed method
Added new simple methods to StubbedMethod, StubbedIOMethod, StubbedZIOMethod.
Examples are below
StubbedMethod - returnsWith
Allows to set result for all arguments
trait Foo:
def foo(x: Int): String
val foo = stub[Foo]
foo.foo.returnsWith("1")StubbedIOMethod - succeedsWith and raisesErrorWith
trait Foo:
def foo(x: Int): IO[String]
val foo = stub[Foo]
for {
_ <- foo.foo.succeedsWith("1")
_ <- foo.foo.raisesErrorWith(new RuntimeException("fail"))
} yield ()
StubbedZIOMethod - succeedsWith, failsWith, diesWith
trait Foo:
def foo(x: Int): IO[Int, String]
val foo = stub[Foo]
for {
_ <- foo.foo.succeedsWith("1")
_ <- foo.foo.failsWith(2)
_ <- foo.foo.diesWith(new RuntimeException("die"))
} yield ()
Updates
- Update cats-effect to 3.6.1 by @scala-steward in #626
- Update munit-cats-effect to 2.1.0 by @scala-steward in #624
- Update zio, zio-test, zio-test-sbt to 2.1.17 by @scala-steward in #625
- Update sbt-ci-release to 1.9.3 by @scala-steward in #620
- Update sbt, scripted-plugin to 1.10.11 by @scala-steward in #621
7.3.0
What's Changed
Bring new stubs with support for ZIO/cats IO to scala 3 LTS, 2.13 and 2.12.
Full Changelog: v7.2.0...v7.3.0