Reputation: 11817
In one of my Rails test case:
test "something" do
assert_raise RuntimeError do
@foo.bar
end
end
I set up the @foo
object such that @foo.bar
does not raise RuntimeError
(ie, the test case will fail)
But the following code passed the test:
test "something" do
blah(@foo)
end
private
def blah(foo)
assert RuntimeError do
foo.bar
end
end
Why is this so?
Upvotes: 1
Views: 397