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/lib | |
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/lib')
-rw-r--r-- | activesupport/lib/active_support/testing/assertions.rb | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/activesupport/lib/active_support/testing/assertions.rb b/activesupport/lib/active_support/testing/assertions.rb index 46eed73d24..b24aa36ede 100644 --- a/activesupport/lib/active_support/testing/assertions.rb +++ b/activesupport/lib/active_support/testing/assertions.rb @@ -159,7 +159,7 @@ module ActiveSupport if to == UNTRACKED error = "#{expression.inspect} didn't change" error = "#{message}.\n#{error}" if message - assert_not_equal before, after, error + assert before != after, error else error = "#{expression.inspect} didn't change to #{to}" error = "#{message}.\n#{error}" if message @@ -190,12 +190,7 @@ module ActiveSupport error = "#{expression.inspect} did change to #{after}" error = "#{message}.\n#{error}" if message - - if before.nil? - assert_nil after, error - else - assert_equal before, after, error - end + assert before == after, error retval end |