aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activesupport/lib/active_support/dependencies.rb4
-rw-r--r--activesupport/test/dependencies_test.rb6
2 files changed, 5 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb
index a8d12366cc..93a11d4586 100644
--- a/activesupport/lib/active_support/dependencies.rb
+++ b/activesupport/lib/active_support/dependencies.rb
@@ -187,7 +187,7 @@ module ActiveSupport #:nodoc:
# top-level constant.
def guess_for_anonymous(const_name)
if Object.const_defined?(const_name)
- raise NameError.new "#{const_name} cannot be autoloaded from an anonymous class or module", const_name.to_s
+ raise NameError.new "#{const_name} cannot be autoloaded from an anonymous class or module", const_name
else
Object
end
@@ -516,7 +516,7 @@ module ActiveSupport #:nodoc:
end
end
- name_error = NameError.new("uninitialized constant #{qualified_name}", qualified_name)
+ name_error = NameError.new("uninitialized constant #{qualified_name}", const_name)
name_error.set_backtrace(caller.reject {|l| l.starts_with? __FILE__ })
raise name_error
end
diff --git a/activesupport/test/dependencies_test.rb b/activesupport/test/dependencies_test.rb
index ef0955e1a8..a013aadd67 100644
--- a/activesupport/test/dependencies_test.rb
+++ b/activesupport/test/dependencies_test.rb
@@ -367,11 +367,11 @@ class DependenciesTest < ActiveSupport::TestCase
with_autoloading_fixtures do
e = assert_raise(NameError) { A::DoesNotExist.nil? }
assert_equal "uninitialized constant A::DoesNotExist", e.message
- assert_equal "A::DoesNotExist", e.name
+ assert_equal :DoesNotExist, e.name
e = assert_raise(NameError) { A::B::DoesNotExist.nil? }
assert_equal "uninitialized constant A::B::DoesNotExist", e.message
- assert_equal "A::B::DoesNotExist", e.name
+ assert_equal :DoesNotExist, e.name
end
end
@@ -539,7 +539,7 @@ class DependenciesTest < ActiveSupport::TestCase
mod = Module.new
e = assert_raise(NameError) { mod::E }
assert_equal 'E cannot be autoloaded from an anonymous class or module', e.message
- assert_equal 'E', e.name
+ assert_equal :E, e.name
end
end