Open SamirTalwar opened 3 years ago
When I run this test using Gradle and the JUnit runner, it succeeds, despite the exception.
package foo import org.junit.runner.RunWith import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers import org.scalatestplus.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) class StrangeTestRunnerBehaviorSpec extends AnyFlatSpec with Matchers { "thing" should "not throw" in { throw StrangeTestRunnerBehaviorSpec.SomethingBadHappened } } object StrangeTestRunnerBehaviorSpec { object SomethingBadHappened extends RuntimeException }
Changing SomethingBadHappened to a class and constructing it with new makes it fail.
SomethingBadHappened
new
The test fails correctly when running using SBT, without @RunWith.
@RunWith
I would expect this test to fail regardless of the runner used.
I tested this with ScalaTest 3.2.9, JUnit 4.13, and ScalaTest + JUnit 3.2.9.0.
Thanks to all of the maintainers of ScalaTest for your hard work!
When I run this test using Gradle and the JUnit runner, it succeeds, despite the exception.
Changing
SomethingBadHappened
to a class and constructing it withnew
makes it fail.The test fails correctly when running using SBT, without
@RunWith
.I would expect this test to fail regardless of the runner used.
I tested this with ScalaTest 3.2.9, JUnit 4.13, and ScalaTest + JUnit 3.2.9.0.
Thanks to all of the maintainers of ScalaTest for your hard work!