aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2016-08-31 08:47:48 +0900
committeryuuji.yaginuma <yuuji.yaginuma@gmail.com>2016-08-31 08:52:23 +0900
commit392d03a2920707dd44f9dfb5d6d0348ee701579e (patch)
tree00db08a3afe8b259c419ca7b1903ee4301b2e597 /activesupport/test
parentb7ec47aa8fa0ba82b092e0965771974a14045d92 (diff)
downloadrails-392d03a2920707dd44f9dfb5d6d0348ee701579e.tar.gz
rails-392d03a2920707dd44f9dfb5d6d0348ee701579e.tar.bz2
rails-392d03a2920707dd44f9dfb5d6d0348ee701579e.zip
use `message` that specified in argument to error message
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/test_case_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/activesupport/test/test_case_test.rb b/activesupport/test/test_case_test.rb
index dfbb8aa41d..d769a8c145 100644
--- a/activesupport/test/test_case_test.rb
+++ b/activesupport/test/test_case_test.rb
@@ -211,6 +211,15 @@ class AssertDifferenceTest < ActiveSupport::TestCase
end
end
+ def test_assert_changes_with_message
+ error = assert_raises Minitest::Assertion do
+ assert_changes "@object.num", "@object.num should 1", to: 1 do
+ end
+ end
+
+ assert_equal "@object.num should 1.\n\"@object.num\" didn't change to 1", error.message
+ end
+
def test_assert_no_changes_pass
assert_no_changes "@object.num" do
# ...