forked from davegurnell/checklist
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue davegurnell#1: Context switching working. More tests needed.
- Loading branch information
Showing
3 changed files
with
24 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package checklist | ||
|
||
import cats._ | ||
import cats.data.Ior | ||
import cats.implicits._ | ||
import org.scalatest.{FreeSpec, Matchers} | ||
|
||
import scala.concurrent.Future | ||
import scala.concurrent.ExecutionContext.Implicits.global | ||
|
||
class ContextSpec extends FreeSpec with Matchers { | ||
|
||
"pass" in { | ||
val rule1 = Rule.pass[Int] | ||
val rule2 = rule1.liftTo[Future] | ||
val combined1 = rule1 and rule2 | ||
val combined2 = rule2 and rule1 | ||
combined1(+1) map (_ should be(Ior.right(+1))) | ||
combined2(+1) map (_ should be(Ior.right(+1))) | ||
} | ||
|
||
} |