Skip to content

Commit

Permalink
Merge pull request #436 from lukestephenson/patch-2
Browse files Browse the repository at this point in the history
Build monix module with scala 3
  • Loading branch information
Baccata authored Dec 1, 2021
2 parents 4cd335e + b381605 commit 693196e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
6 changes: 3 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ lazy val coreMonix = projectMatrix

lazy val coreMonixBio = projectMatrix
.in(file("modules/core/monixBio"))
.sparse(withCE3 = false, withJS = true, withScala3 = false)
.sparse(withCE3 = false, withJS = true, withScala3 = true)
.dependsOn(core)
.settings(WeaverPlugin.simpleLayout)
.settings(
Expand Down Expand Up @@ -356,7 +356,7 @@ lazy val cats = projectMatrix

lazy val monix = projectMatrix
.in(file("modules/framework/monix"))
.sparse(withCE3 = false, withJS = true, withScala3 = false)
.sparse(withCE3 = false, withJS = true, withScala3 = true)
.dependsOn(framework, coreMonix)
.settings(WeaverPlugin.simpleLayout)
.settings(
Expand All @@ -366,7 +366,7 @@ lazy val monix = projectMatrix

lazy val monixBio = projectMatrix
.in(file("modules/framework/monix-bio"))
.sparse(withCE3 = false, withJS = true, withScala3 = false)
.sparse(withCE3 = false, withJS = true, withScala3 = true)
.dependsOn(framework, coreMonixBio)
.settings(WeaverPlugin.simpleLayout)
.settings(
Expand Down
14 changes: 8 additions & 6 deletions modules/core/monixBio/src/weaver/monixbiocompat/suites.scala
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ abstract class MutableIOSuite
with BaseIOSuite
with Expectations.Helpers {

implicit protected def effectCompat = MonixBIOUnsafeRun
final implicit protected def scheduler: Scheduler = effectCompat.scheduler
def getSuite: EffectSuite[Task] = this
implicit protected def effectCompat = MonixBIOUnsafeRun
final implicit protected def scheduler: Scheduler =
MonixBIOUnsafeRun.scheduler
def getSuite: EffectSuite[Task] = this

override def test(name: TestName): PartiallyAppliedTest =
new SubPartiallyAppliedTest(name)
Expand All @@ -70,7 +71,8 @@ trait FunIOSuite
extends FunSuiteF[Task]
with BaseIOSuite
with Expectations.Helpers {
implicit protected def effectCompat = MonixBIOUnsafeRun
final implicit protected def scheduler: Scheduler = effectCompat.scheduler
def getSuite: EffectSuite[Task] = this
implicit protected def effectCompat = MonixBIOUnsafeRun
final implicit protected def scheduler: Scheduler =
MonixBIOUnsafeRun.scheduler
def getSuite: EffectSuite[Task] = this
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import cats.effect.Resource
import weaver.framework.{ DogFood, MonixBIO }

import monix.bio.Task
import sbt.testing.Status
import sbt.testing.Status.{ Error, Failure }

object IOSuiteTest extends MutableIOSuite {
override type Res = DogFood[Task]
Expand All @@ -25,7 +25,7 @@ object IOSuiteTest extends MutableIOSuite {
else None
}
val maybeStatus = maybeEvent.map(_.status())
expect(maybeStatus.contains(Status.Error)) &&
expect(maybeStatus.contains(Error)) &&
expect(maybeThrowable.map(_.getMessage).contains("oh no"))
}
}
Expand All @@ -35,7 +35,7 @@ object IOSuiteTest extends MutableIOSuite {
dogfood.runSuite(TestWithFailedExpectation).map { case (_, events) =>
val maybeEvent = events.headOption
val maybeStatus = maybeEvent.map(_.status())
expect(maybeStatus.contains(Status.Failure))
expect(maybeStatus.contains(Failure))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import cats.effect.Resource
import weaver.framework.{ DogFood, Monix }

import monix.eval.Task
import sbt.testing.Status
import sbt.testing.Status.{ Error, Failure }

object TaskSuiteTest extends MutableTaskSuite {

Expand All @@ -28,7 +28,7 @@ object TaskSuiteTest extends MutableTaskSuite {
val maybeStatus = maybeEvent.map(_.status())

expect.all(
maybeStatus.contains(Status.Error),
maybeStatus.contains(Error),
maybeThrowable.map(_.getMessage).contains("oh no")
)

Expand All @@ -40,7 +40,7 @@ object TaskSuiteTest extends MutableTaskSuite {
dogfood.runSuite(TestWithFailedExpectation).map { case (_, events) =>
val maybeEvent = events.headOption
val maybeStatus = maybeEvent.map(_.status())
expect(maybeStatus.contains(Status.Failure))
expect(maybeStatus.contains(Failure))
}
}

Expand Down

0 comments on commit 693196e

Please sign in to comment.