From 6582c7c54a4be7275ea9df5c787d8e686f74b618 Mon Sep 17 00:00:00 2001 From: "yuuji.yaginuma" Date: Mon, 29 Aug 2016 09:05:32 +0900 Subject: use `inspect` for show `from` value If `from` is nil, in order to avoid the blank is showed. --- activesupport/test/test_case_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'activesupport/test') diff --git a/activesupport/test/test_case_test.rb b/activesupport/test/test_case_test.rb index d3d2ed8d7a..dfbb8aa41d 100644 --- a/activesupport/test/test_case_test.rb +++ b/activesupport/test/test_case_test.rb @@ -138,6 +138,15 @@ class AssertDifferenceTest < ActiveSupport::TestCase end end + def test_assert_changes_with_from_option_with_nil + error = assert_raises Minitest::Assertion do + assert_changes "@object.num", from: nil do + @object.increment + end + end + assert_equal "\"@object.num\" isn't nil", error.message + end + def test_assert_changes_with_to_option assert_changes "@object.num", to: 1 do @object.increment -- cgit v1.2.3