diff options
author | Eileen M. Uchitelle <eileencodes@users.noreply.github.com> | 2018-05-04 11:28:54 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-04 11:28:54 -0400 |
commit | 99e4bb735d955318a7503c404d83c3314350ba20 (patch) | |
tree | af429e3b3ca126d5cc2c2eac1b6baee5733d8eaa /activesupport/test/core_ext/load_error_test.rb | |
parent | bd53f35e250b9e1559e5e971af0e2699d718c0f0 (diff) | |
parent | bfddb67197bf0b5c6ec17e2a35ece9190bec8bac (diff) | |
download | rails-99e4bb735d955318a7503c404d83c3314350ba20.tar.gz rails-99e4bb735d955318a7503c404d83c3314350ba20.tar.bz2 rails-99e4bb735d955318a7503c404d83c3314350ba20.zip |
Merge pull request #32809 from gmcgibbon/fix_load_error_is_missing_nil_path
Fix #29632 - nil #path leads to NoMethodError in LoadError#is_missing?
Diffstat (limited to 'activesupport/test/core_ext/load_error_test.rb')
-rw-r--r-- | activesupport/test/core_ext/load_error_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/load_error_test.rb b/activesupport/test/core_ext/load_error_test.rb index 41b11d0c33..126aa51cb4 100644 --- a/activesupport/test/core_ext/load_error_test.rb +++ b/activesupport/test/core_ext/load_error_test.rb @@ -7,13 +7,20 @@ class TestLoadError < ActiveSupport::TestCase def test_with_require assert_raise(LoadError) { require "no_this_file_don't_exist" } end + def test_with_load assert_raise(LoadError) { load "nor_does_this_one" } end + def test_path begin load "nor/this/one.rb" rescue LoadError => e assert_equal "nor/this/one.rb", e.path end end + + def test_is_missing_with_nil_path + error = LoadError.new(nil) + assert_nothing_raised { error.is_missing?("anything") } + end end |