Last active
April 20, 2018 11:17
-
-
Save davydkov/173f0348150d28ad22e9c8ed12b82378 to your computer and use it in GitHub Desktop.
Files to reproduce https://github.com/pantsbuild/pants/issues/3744
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
MONIX_VER='3.0.0-RC1' | |
jar_library(name='monix', | |
jars=[ | |
scala_jar(org='io.monix', name='monix', rev=MONIX_VER), | |
scala_jar(org='io.monix', name='monix-eval', rev=MONIX_VER), | |
scala_jar(org='io.monix', name='monix-reactive', rev=MONIX_VER), | |
]) | |
jar_library(name='scalatest', | |
jars=[ | |
scala_jar(org='org.scalatest', name='scalatest', rev='3.0.4') | |
]) | |
jar_library(name='reactivestreams-test', | |
jars=[ | |
jar(org='org.reactivestreams', name='reactive-streams-tck', rev='1.0.2') | |
]) | |
junit_tests( | |
name='consumer_specs', | |
sources=['ConsumerReactiveSubscriberSpec.scala'], | |
dependencies=[ | |
':scalatest', | |
':reactivestreams-test', | |
':monix', | |
] | |
) |
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
import monix.eval.Callback | |
import monix.execution.Scheduler | |
import monix.reactive.Consumer | |
import org.reactivestreams.Subscriber | |
import org.reactivestreams.tck.{SubscriberBlackboxVerification, TestEnvironment} | |
import org.scalatest.testng.TestNGSuiteLike | |
class ConsumerReactiveSubscriberSpec | |
extends SubscriberBlackboxVerification[Int](new TestEnvironment(300)) | |
with TestNGSuiteLike { | |
implicit val scheduler = Scheduler.io() | |
override def createSubscriber(): Subscriber[Int] = { | |
Consumer.complete[Int].createSubscriber(Callback.empty, scheduler)._1.toReactive | |
} | |
override def createElement(element: Int): Int = element | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment