@@ -15,68 +15,64 @@ def decrement
15
15
@object . num = 0
16
16
end
17
17
18
- if lambda { } . respond_to? ( :binding )
19
- def test_assert_no_difference
20
- assert_no_difference '@object.num' do
21
- # ...
22
- end
18
+ def test_assert_no_difference
19
+ assert_no_difference '@object.num' do
20
+ # ...
23
21
end
22
+ end
24
23
25
- def test_assert_difference
26
- assert_difference '@object.num' , +1 do
27
- @object . increment
28
- end
24
+ def test_assert_difference
25
+ assert_difference '@object.num' , +1 do
26
+ @object . increment
29
27
end
28
+ end
30
29
31
- def test_assert_difference_with_implicit_difference
32
- assert_difference '@object.num' do
33
- @object . increment
34
- end
30
+ def test_assert_difference_with_implicit_difference
31
+ assert_difference '@object.num' do
32
+ @object . increment
35
33
end
34
+ end
36
35
37
- def test_arbitrary_expression
38
- assert_difference '@object.num + 1' , +2 do
39
- @object . increment
40
- @object . increment
41
- end
36
+ def test_arbitrary_expression
37
+ assert_difference '@object.num + 1' , +2 do
38
+ @object . increment
39
+ @object . increment
42
40
end
41
+ end
43
42
44
- def test_negative_differences
45
- assert_difference '@object.num' , -1 do
46
- @object . decrement
47
- end
43
+ def test_negative_differences
44
+ assert_difference '@object.num' , -1 do
45
+ @object . decrement
48
46
end
47
+ end
49
48
50
- def test_expression_is_evaluated_in_the_appropriate_scope
51
- silence_warnings do
52
- local_scope = local_scope = 'foo'
53
- assert_difference ( 'local_scope; @object.num' ) { @object . increment }
54
- end
49
+ def test_expression_is_evaluated_in_the_appropriate_scope
50
+ silence_warnings do
51
+ local_scope = local_scope = 'foo'
52
+ assert_difference ( 'local_scope; @object.num' ) { @object . increment }
55
53
end
54
+ end
56
55
57
- def test_array_of_expressions
58
- assert_difference [ '@object.num' , '@object.num + 1' ] , +1 do
59
- @object . increment
60
- end
56
+ def test_array_of_expressions
57
+ assert_difference [ '@object.num' , '@object.num + 1' ] , +1 do
58
+ @object . increment
61
59
end
60
+ end
62
61
63
- def test_array_of_expressions_identify_failure
64
- assert_raises ( MiniTest ::Assertion ) do
65
- assert_difference [ '@object.num' , '1 + 1' ] do
66
- @object . increment
67
- end
62
+ def test_array_of_expressions_identify_failure
63
+ assert_raises ( MiniTest ::Assertion ) do
64
+ assert_difference [ '@object.num' , '1 + 1' ] do
65
+ @object . increment
68
66
end
69
67
end
68
+ end
70
69
71
- def test_array_of_expressions_identify_failure_when_message_provided
72
- assert_raises ( MiniTest ::Assertion ) do
73
- assert_difference [ '@object.num' , '1 + 1' ] , 1 , 'something went wrong' do
74
- @object . increment
75
- end
70
+ def test_array_of_expressions_identify_failure_when_message_provided
71
+ assert_raises ( MiniTest ::Assertion ) do
72
+ assert_difference [ '@object.num' , '1 + 1' ] , 1 , 'something went wrong' do
73
+ @object . increment
76
74
end
77
75
end
78
- else
79
- def default_test ; end
80
76
end
81
77
end
82
78
0 commit comments