diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-12-20 21:29:43 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-20 21:29:43 +0900 |
commit | 5232ddad654aad7fc48fb1458c4d776246789409 (patch) | |
tree | e0702359eb3fe085673c62270bdf705a2d4e4749 /railties | |
parent | 8db0d36a967f51af93c79e6e9ffe472dd929281e (diff) | |
parent | 01efbc128d1379d02dd14acf324d011944a1c429 (diff) | |
download | rails-5232ddad654aad7fc48fb1458c4d776246789409.tar.gz rails-5232ddad654aad7fc48fb1458c4d776246789409.tar.bz2 rails-5232ddad654aad7fc48fb1458c4d776246789409.zip |
Merge pull request #31520 from yahonda/introduce_frozen_error_class
Handle `FrozenError` if it is available
Diffstat (limited to 'railties')
-rw-r--r-- | railties/test/application/middleware_test.rb | 2 | ||||
-rw-r--r-- | railties/test/isolation/abstract_unit.rb | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/railties/test/application/middleware_test.rb b/railties/test/application/middleware_test.rb index 470a5326c6..d59384e982 100644 --- a/railties/test/application/middleware_test.rb +++ b/railties/test/application/middleware_test.rb @@ -249,7 +249,7 @@ module ApplicationTests test "can't change middleware after it's built" do boot! - assert_raise RuntimeError do + assert_raise frozen_error_class do app.config.middleware.use Rack::Config end end diff --git a/railties/test/isolation/abstract_unit.rb b/railties/test/isolation/abstract_unit.rb index 96c6f21395..0ca0de5e6f 100644 --- a/railties/test/isolation/abstract_unit.rb +++ b/railties/test/isolation/abstract_unit.rb @@ -406,6 +406,10 @@ class ActiveSupport::TestCase include TestHelpers::Rack include TestHelpers::Generation include ActiveSupport::Testing::Stream + + def frozen_error_class + Object.const_defined?(:FrozenError) ? FrozenError : RuntimeError + end end # Create a scope and build a fixture rails app |