Skip to content

Commit

Permalink
Merge pull request #27174 from kamipo/fix_require_dependency_message_…
Browse files Browse the repository at this point in the history
…format

Fix `require_dependency` message format
  • Loading branch information
matthewd committed Nov 25, 2016
2 parents fed3d32 + d99b384 commit 96a2c96
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion actionview/test/actionpack/abstract/helper_test.rb
Expand Up @@ -109,7 +109,7 @@ def test_includes_controller_default_helper
class InvalidHelpersTest < ActiveSupport::TestCase
def test_controller_raise_error_about_real_require_problem
e = assert_raise(LoadError) { AbstractInvalidHelpers.helper(:invalid_require) }
assert_equal "No such file to load -- very_invalid_file_name", e.message
assert_equal "No such file to load -- very_invalid_file_name.rb", e.message
end

def test_controller_raise_error_about_missing_helper
Expand Down
2 changes: 1 addition & 1 deletion activesupport/lib/active_support/dependencies.rb
Expand Up @@ -242,7 +242,7 @@ def require_or_load(file_name)
# resolution deterministic for constants with the same relative name in
# different namespaces whose evaluation would depend on load order
# otherwise.
def require_dependency(file_name, message = "No such file to load -- %s")
def require_dependency(file_name, message = "No such file to load -- %s.rb")
file_name = file_name.to_path if file_name.respond_to?(:to_path)
unless file_name.is_a?(String)
raise ArgumentError, "the file name must either be a String or implement #to_path -- you passed #{file_name.inspect}"
Expand Down

0 comments on commit 96a2c96

Please sign in to comment.