You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use WordSpec and write two tests with the same name like this:
"trying something" should {
"work as expected" in {}
"work as expected" in {}
}
I get the expected error:
[info] org.scalatest.exceptions.DuplicateTestNameException was thrown inside "trying something" should, construction cannot continue: "Duplicate test name: trying something should work as expected"
However, if the duplicated entry is inside a forAll clause, like the following:
"trying something" should {
val scenarios = Table("value", "first", "first")
forAll(scenarios) { value =>
s"work as expected for $value " in {
}
}
}
I am still going to have duplicate tests, since the value of $value is the same in both cases, but the error message is the rather confusing:
[info] Assertion should be put inside it or they clause, not should, must, when, that, which or can clause.
It would be clearer if the error message could refer to the fact that the values in the Table are leading to duplicate test names.
The text was updated successfully, but these errors were encountered:
When I use
WordSpec
and write two tests with the same name like this:I get the expected error:
However, if the duplicated entry is inside a
forAll
clause, like the following:I am still going to have duplicate tests, since the value of
$value
is the same in both cases, but the error message is the rather confusing:It would be clearer if the error message could refer to the fact that the values in the
Table
are leading to duplicate test names.The text was updated successfully, but these errors were encountered: