aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2018-05-22 18:17:11 -0400
committerGitHub <noreply@github.com>2018-05-22 18:17:11 -0400
commitbe43b1f6de90a7035bf56caa60141675ecf9f088 (patch)
treeb0cbef1b6802663779d4541a3a218b8890cd7884 /activesupport/lib
parent9480618f06ada9e06e8c95ca85d6242debad693a (diff)
parentf4f7659acf22f4f37938034bf78673c81c1511b6 (diff)
downloadrails-be43b1f6de90a7035bf56caa60141675ecf9f088.tar.gz
rails-be43b1f6de90a7035bf56caa60141675ecf9f088.tar.bz2
rails-be43b1f6de90a7035bf56caa60141675ecf9f088.zip
Merge pull request #32822 from lxxxvi/improved_error_message_in_assert_changes
Clearer error message in assert_changes
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/testing/assertions.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/testing/assertions.rb b/activesupport/lib/active_support/testing/assertions.rb
index a891ff616d..6a56da384f 100644
--- a/activesupport/lib/active_support/testing/assertions.rb
+++ b/activesupport/lib/active_support/testing/assertions.rb
@@ -176,7 +176,9 @@ module ActiveSupport
assert before != after, error
unless to == UNTRACKED
- error = "#{expression.inspect} didn't change to #{to}"
+ error = "#{expression.inspect} didn't change to as expected\n"
+ error = "#{error}Expected: #{to.inspect}\n"
+ error = "#{error} Actual: #{after.inspect}"
error = "#{message}.\n#{error}" if message
assert to === after, error
end