In railties/test/application/configuration_test.rb:53
a regex is passed as last argument to assert_raises. The last arg
is intended to be the assertion message and not an expectation to
the error message raised inside the applied block (like it would be
expected with RSpec):
test "config.active_support.bare does not require all of ActiveSupport" do
add_to_config "config.frameworks = []; config.active_support.bare = true"
Dir.chdir("#{app_path}/app") do
require "#{app_path}/config/environment" #
assert_raise(NoMethodError, /day/) { 1.day } # <------
end #
end
This shows its buggyness only when run with classic test
unit:
1) Error:
test_config.active_support.bare_does_not_require_all_of_ActiveSupport(ApplicationTests::InitializerTest):
ActiveSupport::Testing::RemoteError: caught TypeError: compared
with non class/module
test/application/configuration_test.rb:53:in `block (2 levels) in <class:InitializerTest>'
test/application/configuration_test.rb:51:in `chdir'
The patch replaces the assertion:
assert_raises(NoMethodError, /day/) { 1.day }
with:
assert !1.methods.include?(:day), "Integer should not know #day."