Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AllExpectations is returning multiple failed expectations, but not the correct failure reports #320

Closed
jedws opened this issue Jan 14, 2015 · 2 comments

Comments

@jedws
Copy link

jedws commented Jan 14, 2015

import org.specs2.SpecificationWithJUnit
import org.specs2.specification.AllExpectations

class MultiExpectSpec extends SpecificationWithJUnit with AllExpectations {
  def is = s2"Testing $test"
  def test = "hello" must have size (10000) and startWith("bell") and ("asd" must beEqualTo("asdd"))
}

gives:

java.lang.Exception: 'hello' doesn't have size 10000 but size 5 [TestSpec.scala:10]
'hello' doesn't have size 10000 but size 5 [TestSpec.scala:10] [TestSpec.scala:10]
'hello' doesn't have size 10000 but size 5 [TestSpec.scala:10] [TestSpec.scala:10] [TestSpec.scala:10]
  at test.MultiExpectSpec$$anonfun$test$1$$anonfun$apply$1.apply(TestSpec.scala:10)
  at test.MultiExpectSpec$$anonfun$test$1$$anonfun$apply$1.apply(TestSpec.scala:10)
  at test.MultiExpectSpec$$anonfun$test$1.apply(TestSpec.scala:10)
  at test.MultiExpectSpec$$anonfun$test$1.apply(TestSpec.scala:10)
  at test.MultiExpectSpec.test(TestSpec.scala:10)
  at test.MultiExpectSpec$$anonfun$is$1.apply(TestSpec.scala:7)
  at test.MultiExpectSpec$$anonfun$is$1.apply(TestSpec.scala:7)

it also doesn't matter if is only a single failure, it reports multiple times anyway.

@etorreborre
Copy link
Owner

What's not to like about side-effects? I had a look at that and I don't find any obvious solution for now. I'll try to fix when I come back from holidays.

@etorreborre
Copy link
Owner

This is published as 2.4.16-SNAPSHOT.

etorreborre added a commit that referenced this issue Jan 20, 2015
Conflicts:
	core/src/main/scala/org/specs2/specification/AllExpectations.scala
	matcher/src/main/scala/org/specs2/matcher/MatchResultCombinators.scala
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants