From a9aed2ac94d2e0d1a233a3c193985ae78d7e79e9 Mon Sep 17 00:00:00 2001 From: Michael Grosser Date: Fri, 16 Sep 2016 09:44:05 -0700 Subject: 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 --- railties/test/generators/named_base_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'railties/test/generators') diff --git a/railties/test/generators/named_base_test.rb b/railties/test/generators/named_base_test.rb index c58468dfc1..0258b3b9d7 100644 --- a/railties/test/generators/named_base_test.rb +++ b/railties/test/generators/named_base_test.rb @@ -106,9 +106,9 @@ class NamedBaseTest < Rails::Generators::TestCase def test_hide_namespace g = generator ["Hidden"] g.class.stub(:namespace, "hidden") do - assert !Rails::Generators.hidden_namespaces.include?("hidden") + assert_not_includes Rails::Generators.hidden_namespaces, "hidden" g.class.hide! - assert Rails::Generators.hidden_namespaces.include?("hidden") + assert_includes Rails::Generators.hidden_namespaces, "hidden" end end -- cgit v1.2.3