From 2d89a6e78d42c5f941f54534a1f3f41fdc60dd47 Mon Sep 17 00:00:00 2001 From: Docusaurus bot Date: Wed, 26 Jun 2024 01:42:18 +0000 Subject: [PATCH] Deploy website Deploy website version based on ebbf7aba8274a0eb5f12601bc6b46bbd53c1b729 --- docs/getting-started.html | 4 ++-- docs/getting-started/index.html | 4 ++-- docs/user-guide/advanced-topics.html | 20 ++++++++++---------- docs/user-guide/advanced-topics/index.html | 20 ++++++++++---------- docs/user-guide/cats.html | 6 +++--- docs/user-guide/cats/index.html | 6 +++--- docs/user-guide/features.html | 4 ++-- docs/user-guide/features/index.html | 4 ++-- docs/user-guide/matching.html | 4 ++-- docs/user-guide/matching/index.html | 4 ++-- 10 files changed, 38 insertions(+), 38 deletions(-) diff --git a/docs/getting-started.html b/docs/getting-started.html index 6a694f7..776b6f4 100644 --- a/docs/getting-started.html +++ b/docs/getting-started.html @@ -58,8 +58,8 @@

If you are coming from ScalaMock for Scala 2, there are a few changes you need to be aware of. See the FAQ.

Install

To get started with SBT and ScalaTest, add the following dependencies to your build.sbt:

-
libraryDependencies += "eu.monniot" %% "scala3mock" % "0.6.2" % Test
-libraryDependencies += "eu.monniot" %% "scala3mock-scalatest" % "0.6.2" % Test
+
libraryDependencies += "eu.monniot" %% "scala3mock" % "0.6.3" % Test
+libraryDependencies += "eu.monniot" %% "scala3mock-scalatest" % "0.6.3" % Test
 

While some testing framework integration exists, Scala3Mock at its core do not require one. You can learn more about the various testing framework integration by going to to the dedicated page in the user guide. If there is no page, it means no special integration has been written yet (or it is not required).

diff --git a/docs/getting-started/index.html b/docs/getting-started/index.html index 6a694f7..776b6f4 100644 --- a/docs/getting-started/index.html +++ b/docs/getting-started/index.html @@ -58,8 +58,8 @@

If you are coming from ScalaMock for Scala 2, there are a few changes you need to be aware of. See the FAQ.

Install

To get started with SBT and ScalaTest, add the following dependencies to your build.sbt:

-
libraryDependencies += "eu.monniot" %% "scala3mock" % "0.6.2" % Test
-libraryDependencies += "eu.monniot" %% "scala3mock-scalatest" % "0.6.2" % Test
+
libraryDependencies += "eu.monniot" %% "scala3mock" % "0.6.3" % Test
+libraryDependencies += "eu.monniot" %% "scala3mock-scalatest" % "0.6.3" % Test
 

While some testing framework integration exists, Scala3Mock at its core do not require one. You can learn more about the various testing framework integration by going to to the dedicated page in the user guide. If there is no page, it means no special integration has been written yet (or it is not required).

diff --git a/docs/user-guide/advanced-topics.html b/docs/user-guide/advanced-topics.html index eb3eeb4..5c661ed 100644 --- a/docs/user-guide/advanced-topics.html +++ b/docs/user-guide/advanced-topics.html @@ -67,7 +67,7 @@

val fooMock = mock[Foo] -// fooMock: Foo = repl.MdocSession$MdocApp$FooMock$1@2c138b6e +// fooMock: Foo = repl.MdocSession$MdocApp$FooMock$1@6fe37978 when(fooMock.overloaded(_: Int)).expects(10) // res0: CallHandler1[Int, String] = <advanced-topics.md#L31> Foo.overloaded(10) once (never called - UNSATISFIED) @@ -82,7 +82,7 @@

val fooMock = mock[Foo] -// fooMock: Foo = repl.MdocSession$MdocApp$FooMock$2@512f8c5c +// fooMock: Foo = repl.MdocSession$MdocApp$FooMock$2@76bd22ae when(fooMock.polymorphic(_: List[Int])).expects(List(1, 2, 3)) // res3: CallHandler1[List[Int], String] = <advanced-topics.md#L58> Foo.polymorphic[T](List(1, 2, 3)) once (never called - UNSATISFIED) @@ -93,7 +93,7 @@

val fooMock = mock[Foo] -// fooMock: Foo = repl.MdocSession$MdocApp$FooMock$3@32a5069a +// fooMock: Foo = repl.MdocSession$MdocApp$FooMock$3@5cef2423 when(fooMock.curried(_: Int)(_: Double)).expects(10, 1.23) // res4: CallHandler2[Int, Double, String] = <advanced-topics.md#L75> Foo.curried(10, 1.23) once (never called - UNSATISFIED) @@ -106,7 +106,7 @@

val fooMock = mock[Foo] when(fooMock.curried) -// java.lang.ClassCastException: class eu.monniot.scala3mock.functions.MockFunction2 cannot be cast to class eu.monniot.scala3mock.functions.MockFunction1 (eu.monniot.scala3mock.functions.MockFunction2 and eu.monniot.scala3mock.functions.MockFunction1 are in unnamed module of loader sbt.internal.LayeredClassLoader @349ae1a3) +// java.lang.ClassCastException: class eu.monniot.scala3mock.functions.MockFunction2 cannot be cast to class eu.monniot.scala3mock.functions.MockFunction1 (eu.monniot.scala3mock.functions.MockFunction2 and eu.monniot.scala3mock.functions.MockFunction1 are in unnamed module of loader sbt.internal.LayeredClassLoader @2ccfeb42) // at repl.MdocSession$MdocApp.$init$$$anonfun$1(advanced-topics.md:93)

At the moment the when macro isn't smart enough to recognize a curried function whereas the mock macro is. That result in the underlying mock correctly creating a MockFunction2[Int, Double, String] (two args) but the when macro exposes a MockFunction1[Int, Double => String] (one arg).

@@ -119,10 +119,10 @@

val fooMock = mock[Foo] -// fooMock: Foo = repl.MdocSession$MdocApp$FooMock$5@52d2ee1d +// fooMock: Foo = repl.MdocSession$MdocApp$FooMock$5@454f9ce2 when(fooMock.takesRepeatedParameter).expects(42, Seq("red", "green", "blue")) // res6: CallHandler2[Int, Seq[String], Unit] = <advanced-topics.md#L130> Foo.takesRepeatedParameter(42, List(red, green, blue)) once (never called - UNSATISFIED) @@ -145,7 +145,7 @@

val fooMock = mock[Foo] -// fooMock: Foo = repl.MdocSession$MdocApp$FooMock$6@aecc5ae +// fooMock: Foo = repl.MdocSession$MdocApp$FooMock$6@21553b5c when(fooMock.increment).expects(12).returning(13) // res7: CallHandler1[Int, Int] = <advanced-topics.md#L147> Foo.increment(12) once (called once) @@ -235,7 +235,7 @@

val fooMock = mock[Foo] -// fooMock: Foo = repl.MdocSession$MdocApp$FooMock$7@4c056bb6 +// fooMock: Foo = repl.MdocSession$MdocApp$FooMock$7@49b25c7d // Using the throws or throwing function @@ -286,7 +286,7 @@

} val m = mock[Test] -// m: Test = repl.MdocSession$MdocApp$TestMock$1@5466302d +// m: Test = repl.MdocSession$MdocApp$TestMock$1@32ce127d when(() => m.zeroParameter()).expects().returns(1) // res36: CallHandler0[Int] = <advanced-topics.md#L374> Test.zeroParameter() once (never called - UNSATISFIED) diff --git a/docs/user-guide/advanced-topics/index.html b/docs/user-guide/advanced-topics/index.html index eb3eeb4..5c661ed 100644 --- a/docs/user-guide/advanced-topics/index.html +++ b/docs/user-guide/advanced-topics/index.html @@ -67,7 +67,7 @@

val fooMock = mock[Foo] -// fooMock: Foo = repl.MdocSession$MdocApp$FooMock$1@2c138b6e +// fooMock: Foo = repl.MdocSession$MdocApp$FooMock$1@6fe37978 when(fooMock.overloaded(_: Int)).expects(10) // res0: CallHandler1[Int, String] = <advanced-topics.md#L31> Foo.overloaded(10) once (never called - UNSATISFIED) @@ -82,7 +82,7 @@

val fooMock = mock[Foo] -// fooMock: Foo = repl.MdocSession$MdocApp$FooMock$2@512f8c5c +// fooMock: Foo = repl.MdocSession$MdocApp$FooMock$2@76bd22ae when(fooMock.polymorphic(_: List[Int])).expects(List(1, 2, 3)) // res3: CallHandler1[List[Int], String] = <advanced-topics.md#L58> Foo.polymorphic[T](List(1, 2, 3)) once (never called - UNSATISFIED) @@ -93,7 +93,7 @@

val fooMock = mock[Foo] -// fooMock: Foo = repl.MdocSession$MdocApp$FooMock$3@32a5069a +// fooMock: Foo = repl.MdocSession$MdocApp$FooMock$3@5cef2423 when(fooMock.curried(_: Int)(_: Double)).expects(10, 1.23) // res4: CallHandler2[Int, Double, String] = <advanced-topics.md#L75> Foo.curried(10, 1.23) once (never called - UNSATISFIED) @@ -106,7 +106,7 @@

val fooMock = mock[Foo] when(fooMock.curried) -// java.lang.ClassCastException: class eu.monniot.scala3mock.functions.MockFunction2 cannot be cast to class eu.monniot.scala3mock.functions.MockFunction1 (eu.monniot.scala3mock.functions.MockFunction2 and eu.monniot.scala3mock.functions.MockFunction1 are in unnamed module of loader sbt.internal.LayeredClassLoader @349ae1a3) +// java.lang.ClassCastException: class eu.monniot.scala3mock.functions.MockFunction2 cannot be cast to class eu.monniot.scala3mock.functions.MockFunction1 (eu.monniot.scala3mock.functions.MockFunction2 and eu.monniot.scala3mock.functions.MockFunction1 are in unnamed module of loader sbt.internal.LayeredClassLoader @2ccfeb42) // at repl.MdocSession$MdocApp.$init$$$anonfun$1(advanced-topics.md:93)

At the moment the when macro isn't smart enough to recognize a curried function whereas the mock macro is. That result in the underlying mock correctly creating a MockFunction2[Int, Double, String] (two args) but the when macro exposes a MockFunction1[Int, Double => String] (one arg).

@@ -119,10 +119,10 @@

val fooMock = mock[Foo] -// fooMock: Foo = repl.MdocSession$MdocApp$FooMock$5@52d2ee1d +// fooMock: Foo = repl.MdocSession$MdocApp$FooMock$5@454f9ce2 when(fooMock.takesRepeatedParameter).expects(42, Seq("red", "green", "blue")) // res6: CallHandler2[Int, Seq[String], Unit] = <advanced-topics.md#L130> Foo.takesRepeatedParameter(42, List(red, green, blue)) once (never called - UNSATISFIED) @@ -145,7 +145,7 @@

val fooMock = mock[Foo] -// fooMock: Foo = repl.MdocSession$MdocApp$FooMock$6@aecc5ae +// fooMock: Foo = repl.MdocSession$MdocApp$FooMock$6@21553b5c when(fooMock.increment).expects(12).returning(13) // res7: CallHandler1[Int, Int] = <advanced-topics.md#L147> Foo.increment(12) once (called once) @@ -235,7 +235,7 @@

val fooMock = mock[Foo] -// fooMock: Foo = repl.MdocSession$MdocApp$FooMock$7@4c056bb6 +// fooMock: Foo = repl.MdocSession$MdocApp$FooMock$7@49b25c7d // Using the throws or throwing function @@ -286,7 +286,7 @@

} val m = mock[Test] -// m: Test = repl.MdocSession$MdocApp$TestMock$1@5466302d +// m: Test = repl.MdocSession$MdocApp$TestMock$1@32ce127d when(() => m.zeroParameter()).expects().returns(1) // res36: CallHandler0[Int] = <advanced-topics.md#L374> Test.zeroParameter() once (never called - UNSATISFIED) diff --git a/docs/user-guide/cats.html b/docs/user-guide/cats.html index b3f5e0b..678ceda 100644 --- a/docs/user-guide/cats.html +++ b/docs/user-guide/cats.html @@ -56,7 +56,7 @@ });

Cats Integration

Scala3Mock comes with a Cats integration that provides a withExpectations function that work with a MonadError[?, Throwable] instead of the simple value that the default library provide. This is pretty useful if your tests are defined in term of monads (Cats-Effect's IO, Scala's Future via alleycats, etc…).

You'll need to add a new dependency to your build.sbt:

-
libraryDependencies += "eu.monniot" %% "scala3mock-cats" % "0.6.2" % Test
+
libraryDependencies += "eu.monniot" %% "scala3mock-cats" % "0.6.3" % Test
 

Once added, simply replace the ScalaMocks import with the Cats one:

- import eu.monniot.scala3mock.ScalaMocks.*
@@ -75,9 +75,9 @@
 // fa: SyncIO[String] = FlatMap(
 //   ioe = Suspend(
 //     hint = Delay,
-//     thunk = repl.MdocSession$MdocApp$$Lambda$11942/0x0000000102fe7840@7dc745e8
+//     thunk = repl.MdocSession$MdocApp$$Lambda$11889/0x0000000102fe2440@25505d4b
 //   ),
-//   f = eu.monniot.scala3mock.cats.ScalaMocks$package$$$Lambda$11943/0x0000000102fe7040@2500404c
+//   f = eu.monniot.scala3mock.cats.ScalaMocks$package$$$Lambda$11890/0x0000000102fe7040@3f3a3c63
 // )
 
 fa.unsafeRunSync()
diff --git a/docs/user-guide/cats/index.html b/docs/user-guide/cats/index.html
index b3f5e0b..678ceda 100644
--- a/docs/user-guide/cats/index.html
+++ b/docs/user-guide/cats/index.html
@@ -56,7 +56,7 @@
             });
         

Cats Integration

Scala3Mock comes with a Cats integration that provides a withExpectations function that work with a MonadError[?, Throwable] instead of the simple value that the default library provide. This is pretty useful if your tests are defined in term of monads (Cats-Effect's IO, Scala's Future via alleycats, etc…).

You'll need to add a new dependency to your build.sbt:

-
libraryDependencies += "eu.monniot" %% "scala3mock-cats" % "0.6.2" % Test
+
libraryDependencies += "eu.monniot" %% "scala3mock-cats" % "0.6.3" % Test
 

Once added, simply replace the ScalaMocks import with the Cats one:

- import eu.monniot.scala3mock.ScalaMocks.*
@@ -75,9 +75,9 @@
 // fa: SyncIO[String] = FlatMap(
 //   ioe = Suspend(
 //     hint = Delay,
-//     thunk = repl.MdocSession$MdocApp$$Lambda$11942/0x0000000102fe7840@7dc745e8
+//     thunk = repl.MdocSession$MdocApp$$Lambda$11889/0x0000000102fe2440@25505d4b
 //   ),
-//   f = eu.monniot.scala3mock.cats.ScalaMocks$package$$$Lambda$11943/0x0000000102fe7040@2500404c
+//   f = eu.monniot.scala3mock.cats.ScalaMocks$package$$$Lambda$11890/0x0000000102fe7040@3f3a3c63
 // )
 
 fa.unsafeRunSync()
diff --git a/docs/user-guide/features.html b/docs/user-guide/features.html
index 4853ff1..3581ca7 100644
--- a/docs/user-guide/features.html
+++ b/docs/user-guide/features.html
@@ -97,9 +97,9 @@
 

Mocking

Scala3Mock can create mock out of classes (abstract or not, with parameters or not) and traits.

val heaterMock  = mock[Heater]
-// heaterMock: Heater = repl.MdocSession$MdocApp$HeaterMock$1@4621f5fe
+// heaterMock: Heater = repl.MdocSession$MdocApp$HeaterMock$1@6ebbdd24
 val dbMock      = mock[Database]
-// dbMock: Database = repl.MdocSession$MdocApp$DatabaseMock$1@6257f82c
+// dbMock: Database = repl.MdocSession$MdocApp$DatabaseMock$1@479c8f84
 

Argument matching

// expect someMethod("foo", 42) to be called
diff --git a/docs/user-guide/features/index.html b/docs/user-guide/features/index.html
index 4853ff1..3581ca7 100644
--- a/docs/user-guide/features/index.html
+++ b/docs/user-guide/features/index.html
@@ -97,9 +97,9 @@
 

Mocking

Scala3Mock can create mock out of classes (abstract or not, with parameters or not) and traits.

val heaterMock  = mock[Heater]
-// heaterMock: Heater = repl.MdocSession$MdocApp$HeaterMock$1@4621f5fe
+// heaterMock: Heater = repl.MdocSession$MdocApp$HeaterMock$1@6ebbdd24
 val dbMock      = mock[Database]
-// dbMock: Database = repl.MdocSession$MdocApp$DatabaseMock$1@6257f82c
+// dbMock: Database = repl.MdocSession$MdocApp$DatabaseMock$1@479c8f84
 

Argument matching

// expect someMethod("foo", 42) to be called
diff --git a/docs/user-guide/matching.html b/docs/user-guide/matching.html
index 63a19ce..5694141 100644
--- a/docs/user-guide/matching.html
+++ b/docs/user-guide/matching.html
@@ -92,7 +92,7 @@ 

val leaderBoardMock = mock[PlayerLeaderBoard] -// leaderBoardMock: PlayerLeaderBoard = repl.MdocSession$MdocApp$PlayerLeaderBoardMock$1@6feb4a79 +// leaderBoardMock: PlayerLeaderBoard = repl.MdocSession$MdocApp$PlayerLeaderBoardMock$1@333b151b

Now imagine that we want to put an expectation that addPointsForPlayer is called with:

Now imagine that we want to put an expectation that addPointsForPlayer is called with: