8000 Releases · scalamock/scalamock · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Releases: scalamock/scalamock

7.3.2

30 Apr 13:04
b33bfb7
Compare
Choose a tag to compare

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:

  1. returns in StubbedMethod0 is deprecated, returnsWith should be used instead
  2. returnsZIO in StubbedZIOMethod0 is deprecated, returnsZIOWith or other methods should be used instead
  3. returnsIO in StubbedIOMethod0 is deprecated, returnsIOWith or 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

18 Apr 12:53
061a624
Compare
Choose a tag to compare

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 {
  _ &l
10000
t;- foo.foo.succeedsWith("1")
  _ <- foo.foo.failsWith(2)
  _ <- foo.foo.diesWith(new RuntimeException("die"))
} yield ()

Updates

7.3.0

25 Mar 08:53
113fcea
Compare
Choose a tag to compare

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

7.3.0-RC4

09 Mar 12:49
9327cf5
Compare
Choose a tag to compare

Fixes bug introduced in 7.3.0-RC3 when timesIO runs forever

Changes to scalamock 7 Stubs

  1. Bring Stub[T] to scala 2 to make it same as for scala 3. Implicit conversions will compile only for Stub[T]
  2. Fix issue for scala 3 when compilation not fails even if it should due to better language type inference.
  3. Improve scaladoc
  4. Remove auto eta-expansion for any nullary method selection in scala 3 to show correct errors. You should declare method selection as () => R which scala itself enforces
trait Foo:
  def nullary: String

val foo = stub[Foo]

foo.nullary.returns("") // No longer compiles
(() => foo.nullary).returns("") // Compiles

The only exception is IO and ZIO types, still works for them. Now also works for scala 2.

trait Foo {
  def nullary: IO[Int]
}

val foo = stub[Foo]
  
foo.nullary.returns(IO(1)) // Compiles

7.3.0-RC3

09 Mar 10:55
1e63772
Compare
Choose a tag to compare

Changes to scalamock 7 Stubs

  1. Bring Stub[T] to scala 2 to make it same as for scala 3. Implicit conversions will compile only for Stub[T]
  2. Fix issue for scala 3 when compilation not fails even if it should due to better language type inference.
  3. Improve scaladoc
  4. Remove auto eta-expansion for any nullary method selection in scala 3 to show correct errors. You should declare method selection as () => R which scala itself enforces
trait Foo:
  def nullary: String

val foo = stub[Foo]

foo.nullary.returns("") // No longer compiles
(() => foo.nullary).returns("") // Compiles

The only exception is IO and ZIO types, still works for them. Now also works for scala 2.

trait Foo {
  def nullary: IO[Int]
}

val foo = stub[Foo]
  
foo.nullary.returns(IO(1)) // Compiles

7.3.0-RC2

02 Mar 17:23
aa4eebf
Compare
Choose a tag to compare

What's Changed

Full Changelog: v7.3.0-RC1...v7.3.0-RC2

v7.3.0-RC1

24 Feb 12:34
570af40
Compare
Choose a tag to compare

What's Changed

  1. Backport stubs to scala 2.12 and 2.13 (No other notable changes, so upgrade from scalamock 6 should be without any problems)
  2. Downgrade scala 3 compiler to 3.3.0, this allows to remove @experimental annotation
  3. Downgrade java to 11
  4. Huge refactoring to make it compatible with scala 2. Should be no breaking changes

v7.2.0

07 Feb 07:32
a2fd177
Compare
Choose a tag to compare

What's Changed

Full Changelog: v7.1.0...v7.2.0

v6.2.0

07 Feb 07:30
a7403c3
Compare
Choose a tag to compare

What's Changed

Full Changelog: v6.1.1...v6.2.0

7.1.0

16 Jan 09:34
3329fad
Compare
Choose a tag to compare

What's Changed

Full Changelog: v7.0.1...v7.1.0

0