diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2016-09-16 16:34:36 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-16 16:34:36 -0300 |
commit | 84650022d574d24d6adea6ad941ec3ca57d2a2f0 (patch) | |
tree | 07318ea156bb21b19042fe2bebc7a713ab0a02e7 /activesupport/test/dependencies_test.rb | |
parent | c5c1a29be7d435fe569c9e15c22db65768b50318 (diff) | |
parent | a9aed2ac94d2e0d1a233a3c193985ae78d7e79e9 (diff) | |
download | rails-84650022d574d24d6adea6ad941ec3ca57d2a2f0.tar.gz rails-84650022d574d24d6adea6ad941ec3ca57d2a2f0.tar.bz2 rails-84650022d574d24d6adea6ad941ec3ca57d2a2f0.zip |
Merge pull request #26516 from grosser/grosser/assert
improve error message when include assertions fail
Diffstat (limited to 'activesupport/test/dependencies_test.rb')
-rw-r--r-- | activesupport/test/dependencies_test.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/activesupport/test/dependencies_test.rb b/activesupport/test/dependencies_test.rb index e0edb4a086..54068f5a08 100644 --- a/activesupport/test/dependencies_test.rb +++ b/activesupport/test/dependencies_test.rb @@ -114,25 +114,25 @@ class DependenciesTest < ActiveSupport::TestCase assert_equal 1, $check_warnings_load_count assert_equal true, $checked_verbose, "On first load warnings should be enabled." - assert ActiveSupport::Dependencies.loaded.include?(expanded) + assert_includes ActiveSupport::Dependencies.loaded, expanded ActiveSupport::Dependencies.clear assert_not ActiveSupport::Dependencies.loaded.include?(expanded) - assert ActiveSupport::Dependencies.history.include?(expanded) + assert_includes ActiveSupport::Dependencies.history, expanded silence_warnings { require_dependency filename } assert_equal 2, $check_warnings_load_count assert_equal nil, $checked_verbose, "After first load warnings should be left alone." - assert ActiveSupport::Dependencies.loaded.include?(expanded) + assert_includes ActiveSupport::Dependencies.loaded, expanded ActiveSupport::Dependencies.clear assert_not ActiveSupport::Dependencies.loaded.include?(expanded) - assert ActiveSupport::Dependencies.history.include?(expanded) + assert_includes ActiveSupport::Dependencies.history, expanded enable_warnings { require_dependency filename } assert_equal 3, $check_warnings_load_count assert_equal true, $checked_verbose, "After first load warnings should be left alone." - assert ActiveSupport::Dependencies.loaded.include?(expanded) + assert_includes ActiveSupport::Dependencies.loaded, expanded ActiveSupport::Dependencies.warnings_on_first_load = old_warnings end end @@ -1059,13 +1059,13 @@ class DependenciesTest < ActiveSupport::TestCase end def test_load_and_require_stay_private - assert Object.private_methods.include?(:load) - assert Object.private_methods.include?(:require) + assert_includes Object.private_methods, :load + assert_includes Object.private_methods, :require ActiveSupport::Dependencies.unhook! - assert Object.private_methods.include?(:load) - assert Object.private_methods.include?(:require) + assert_includes Object.private_methods, :load + assert_includes Object.private_methods, :require ensure ActiveSupport::Dependencies.hook! end |