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
I'm not very sure about this idea, and would like to hear what the maintainers think. What would you think of making RSpec warn about examples which don't contain any assertions, or anything which could make the test fail?
Of course, any test can fail if it raises an uncaught exception. But if the tester's intention is to just check for uncaught exceptions, it would be better to use expect { ... }.not_to raise_error, to express that intention explicitly.
Where this came from: I am just updating a RSpec 2 suite to RSpec 3, and I discovered some old, forgotten "tests" which don't test anything at all. They look something like this:
it"returns the right value"doactual.value == expected.valueend
I'm sure that the author meant actual.value.should == expected.value.
The text was updated successfully, but these errors were encountered:
I'm not very sure about this idea, and would like to hear what the maintainers think. What would you think of making RSpec warn about examples which don't contain any assertions, or anything which could make the test fail?
Of course, any test can fail if it raises an uncaught exception. But if the tester's intention is to just check for uncaught exceptions, it would be better to use
expect { ... }.not_to raise_error
, to express that intention explicitly.Where this came from: I am just updating a RSpec 2 suite to RSpec 3, and I discovered some old, forgotten "tests" which don't test anything at all. They look something like this:
I'm sure that the author meant
actual.value.should == expected.value
.The text was updated successfully, but these errors were encountered: