aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/abstract/helper_test.rb
diff options
context:
space:
mode:
authorAndrew White <andrew.white@unboxed.co>2016-11-02 16:00:37 +0000
committerAndrew White <andrew.white@unboxed.co>2016-11-02 16:15:00 +0000
commit1f62443319c1b95c6e747a5de5e7e1041c64cbcb (patch)
tree9a0157258850bf3a98163a84dfd7322c3a0f92e8 /actionpack/test/abstract/helper_test.rb
parent6341c1c698e69fdaba4fd212d16ab3e8979e9c6e (diff)
downloadrails-1f62443319c1b95c6e747a5de5e7e1041c64cbcb.tar.gz
rails-1f62443319c1b95c6e747a5de5e7e1041c64cbcb.tar.bz2
rails-1f62443319c1b95c6e747a5de5e7e1041c64cbcb.zip
Fix inconsistencies in path with missing helpers
Ruby 2.0 and later demonstrate some inconsistencies when a helper file is not found with the path method on LoadError. By creating a subclass of LoadError we can cater for the inconsistencies.
Diffstat (limited to 'actionpack/test/abstract/helper_test.rb')
-rw-r--r--actionpack/test/abstract/helper_test.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/actionpack/test/abstract/helper_test.rb b/actionpack/test/abstract/helper_test.rb
index b28a5b5afb..2e86e7e859 100644
--- a/actionpack/test/abstract/helper_test.rb
+++ b/actionpack/test/abstract/helper_test.rb
@@ -69,7 +69,10 @@ module AbstractController
end
def test_declare_missing_helper
- assert_raise(MissingSourceFile) { AbstractHelpers.helper :missing }
+ e = assert_raise AbstractController::Helpers::MissingHelperError do
+ AbstractHelpers.helper :missing
+ end
+ assert_equal "helpers/missing_helper.rb", e.path
end
def test_helpers_with_module_through_block