File tree 1 file changed +8
-13
lines changed
1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -61,24 +61,19 @@ def test_array_of_expressions
61
61
end
62
62
63
63
def test_array_of_expressions_identify_failure
64
- assert_difference [ '@object.num' , '1 + 1' ] do
65
- @object . increment
64
+ assert_raises ( MiniTest ::Assertion ) do
65
+ assert_difference [ '@object.num' , '1 + 1' ] do
66
+ @object . increment
67
+ end
66
68
end
67
- fail 'should not get to here'
68
- rescue Exception => e
69
- assert_match ( /didn't change by/ , e . message )
70
- assert_match ( /expected but was/ , e . message )
71
69
end
72
70
73
71
def test_array_of_expressions_identify_failure_when_message_provided
74
- assert_difference [ '@object.num' , '1 + 1' ] , 1 , 'something went wrong' do
75
- @object . increment
72
+ assert_raises ( MiniTest ::Assertion ) do
73
+ assert_difference [ '@object.num' , '1 + 1' ] , 1 , 'something went wrong' do
74
+ @object . increment
75
+ end
76
76
end
77
- fail 'should not get to here'
78
- rescue Exception => e
79
- assert_match ( /something went wrong/ , e . message )
80
- assert_match ( /didn't change by/ , e . message )
81
- assert_match ( /expected but was/ , e . message )
82
77
end
83
78
else
84
79
def default_test ; end
You can’t perform that action at this time.
0 commit comments