Packages

  • package root
    Definition Classes
    root
  • trait MonixTaskSpec extends AssertingSyntax

    The code has been copied from cats-effect-testing and fs2 effect test support, with the difference it provides support for Task instead of IO.

    The code has been copied from cats-effect-testing and fs2 effect test support, with the difference it provides support for Task instead of IO.

    Definition Classes
    root
    See also

    https://github.com/typelevel/cats-effect-testing https://github.com/typelevel/cats-effect-testing/blob/series/1.x/scalatest/shared/src/main/scala/cats/effect/testing/scalatest/AsyncIOSpec.scala https://github.com/functional-streams-for-scala/fs2/blob/188a37883d7bbdf22bc4235a3a1223b14dc10b6c/core/shared/src/test/scala/fs2/EffectTestSupport.scala Provides support for testing Monix Task with scalatest AsyncTestSuite. It provides a set of implicit conversions to convert Task to Future, so the user does not need to do it for every test.

    Example

    import monix.eval.Task
    import monix.execution.Scheduler
    import org.scalatest.funsuite.AsyncFunSuite
    import org.scalatest.matchers.should.Matchers
    
    class DummySpec extends AsyncFunSuite with MonixTaskSpec with Matchers {
    
        override implicit def scheduler: Scheduler = Scheduler.io("monix-task-support-spec")
    
        test("AsyncTestSuite with Task support") {
            for {
                r1 <- Task(2)
                r2 <- Task(r1 * 3)
            } yield {
                r1 shouldBe 2
                r2 shouldBe 6
            }
        // we do not have to append `.runToFuture` as we would would using a plain [[AsyncFunSuit]].
        }
    
        test("AsyncTestSuite with Task and AssertingSyntax support") {
            Task(2).flatMap(r1 => Task(r1 * 3)).asserting(_ shouldBe 6)
        }
t

MonixTaskSpec

trait MonixTaskSpec extends AssertingSyntax

The code has been copied from cats-effect-testing and fs2 effect test support, with the difference it provides support for Task instead of IO.

Self Type
MonixTaskSpec with AsyncTestSuite
See also

https://github.com/typelevel/cats-effect-testing https://github.com/typelevel/cats-effect-testing/blob/series/1.x/scalatest/shared/src/main/scala/cats/effect/testing/scalatest/AsyncIOSpec.scala https://github.com/functional-streams-for-scala/fs2/blob/188a37883d7bbdf22bc4235a3a1223b14dc10b6c/core/shared/src/test/scala/fs2/EffectTestSupport.scala Provides support for testing Monix Task with scalatest AsyncTestSuite. It provides a set of implicit conversions to convert Task to Future, so the user does not need to do it for every test.

Example

import monix.eval.Task
import monix.execution.Scheduler
import org.scalatest.funsuite.AsyncFunSuite
import org.scalatest.matchers.should.Matchers

class DummySpec extends AsyncFunSuite with MonixTaskSpec with Matchers {

    override implicit def scheduler: Scheduler = Scheduler.io("monix-task-support-spec")

    test("AsyncTestSuite with Task support") {
        for {
            r1 <- Task(2)
            r2 <- Task(r1 * 3)
        } yield {
            r1 shouldBe 2
            r2 shouldBe 6
        }
    // we do not have to append `.runToFuture` as we would would using a plain [[AsyncFunSuit]].
    }

    test("AsyncTestSuite with Task and AssertingSyntax support") {
        Task(2).flatMap(r1 => Task(r1 * 3)).asserting(_ shouldBe 6)
    }
Linear Supertypes
AssertingSyntax, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MonixTaskSpec
  2. AssertingSyntax
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. implicit class Asserting[F[_], A] extends AnyRef
    Definition Classes
    AssertingSyntax

Abstract Value Members

  1. implicit abstract def scheduler: Scheduler

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  16. implicit def taskRetrying[T]: Retrying[Task[T]]
  17. implicit def taskToFutureAssertion(task: Task[Assertion]): Future[Assertion]
  18. implicit def taskUnitToFutureAssertion(task: Task[Unit]): Future[Assertion]
  19. def toString(): String
    Definition Classes
    AnyRef → Any
  20. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from AssertingSyntax

Inherited from AnyRef

Inherited from Any

Ungrouped