aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/test_case_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/test_case_test.rb')
-rw-r--r--activesupport/test/test_case_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activesupport/test/test_case_test.rb b/activesupport/test/test_case_test.rb
index 9e6d1a91d0..18228a2ac5 100644
--- a/activesupport/test/test_case_test.rb
+++ b/activesupport/test/test_case_test.rb
@@ -56,6 +56,14 @@ class AssertDifferenceTest < ActiveSupport::TestCase
end
end
+ def test_assert_difference_retval
+ incremented = assert_difference '@object.num', +1 do
+ @object.increment
+ end
+
+ assert_equal incremented, 1
+ end
+
def test_assert_difference_with_implicit_difference
assert_difference '@object.num' do
@object.increment