diff options
author | Michael Grosser <michael@grosser.it> | 2016-09-16 09:44:05 -0700 |
---|---|---|
committer | Michael Grosser <michael@grosser.it> | 2016-09-16 12:03:37 -0700 |
commit | a9aed2ac94d2e0d1a233a3c193985ae78d7e79e9 (patch) | |
tree | d550056dbf4a70b5c7562f1a715045c5a3968b0c /activerecord/test/cases/attributes_test.rb | |
parent | f62451a50b2c9119adce7acc53ce3dfffc4d41d5 (diff) | |
download | rails-a9aed2ac94d2e0d1a233a3c193985ae78d7e79e9.tar.gz rails-a9aed2ac94d2e0d1a233a3c193985ae78d7e79e9.tar.bz2 rails-a9aed2ac94d2e0d1a233a3c193985ae78d7e79e9.zip |
improve error message when include assertions fail
assert [1, 3].includes?(2) fails with unhelpful "Asserting failed" message
assert_includes [1, 3], 2 fails with "Expected [1, 3] to include 2" which makes it easier to debug and more obvious what went wrong
Diffstat (limited to 'activerecord/test/cases/attributes_test.rb')
-rw-r--r-- | activerecord/test/cases/attributes_test.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/test/cases/attributes_test.rb b/activerecord/test/cases/attributes_test.rb index c18851257e..f4620ae2da 100644 --- a/activerecord/test/cases/attributes_test.rb +++ b/activerecord/test/cases/attributes_test.rb @@ -112,7 +112,7 @@ module ActiveRecord assert_equal 7, klass.attribute_types.length assert_equal 7, klass.column_defaults.length - assert klass.attribute_types.include?("wibble") + assert_includes klass.attribute_types, "wibble" end test "the given default value is cast from user" do @@ -253,7 +253,7 @@ module ActiveRecord test "attributes not backed by database columns appear in inspect" do inspection = OverloadedType.new.inspect - assert inspection.include?("non_existent_decimal") + assert_includes inspection, "non_existent_decimal" end end end |