Reputation: 548
In my program, I use raise "text" to prevent creating an object when parameters are wrong.
How can I check this in Test/Unit?
assert_ ? (MyObject.new(wrong,parameter))
How can I check that my object was not created?
Upvotes: 0
Views: 71
Reputation: 548
def test_illegal
assert_raise( RuntimeError ) { MyObject.new('a') }
end
Upvotes: 2