diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2017-11-09 00:57:21 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-09 00:57:21 -0500 |
commit | 8614a3a9763fad9f8e454cd3aa24afb71c132a9f (patch) | |
tree | e51c8934178a66a129ab04f8c6d51b019e2bf2c9 /activesupport/test | |
parent | 25f926f1cd95f6e35c924c2dc54c3ccd48d8a7a2 (diff) | |
parent | bbe437faecca5fd6bdc2327a4bc7a31ba21afe2e (diff) | |
download | rails-8614a3a9763fad9f8e454cd3aa24afb71c132a9f.tar.gz rails-8614a3a9763fad9f8e454cd3aa24afb71c132a9f.tar.bz2 rails-8614a3a9763fad9f8e454cd3aa24afb71c132a9f.zip |
Merge pull request #31077 from gsamokovarov/assert-changes-nil
Use plain assert in assert_changes to avoid MT6 refutes
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/test_case_test.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/activesupport/test/test_case_test.rb b/activesupport/test/test_case_test.rb index 9bc9183668..84e4953fe2 100644 --- a/activesupport/test/test_case_test.rb +++ b/activesupport/test/test_case_test.rb @@ -179,6 +179,7 @@ class AssertDifferenceTest < ActiveSupport::TestCase end def test_assert_changes_works_with_any_object + # Silences: instance variable @new_object not initialized. retval = silence_warnings do assert_changes :@new_object, from: nil, to: 42 do @new_object = 42 @@ -201,7 +202,7 @@ class AssertDifferenceTest < ActiveSupport::TestCase def test_assert_changes_with_to_and_case_operator token = nil - assert_changes -> { token }, to: /\w{32}/ do + assert_changes -> { token }, to: /\w{32}/ do token = SecureRandom.hex end end @@ -236,7 +237,7 @@ class AssertDifferenceTest < ActiveSupport::TestCase end end - assert_equal "@object.num should not change.\n\"@object.num\" did change to 1.\nExpected: 0\n Actual: 1", error.message + assert_equal "@object.num should not change.\n\"@object.num\" did change to 1", error.message end end |