diff options
author | Mike Moore <mike@blowmage.com> | 2012-09-25 15:40:00 -0600 |
---|---|---|
committer | Mike Moore <mike@blowmage.com> | 2012-09-25 15:40:00 -0600 |
commit | b13400086c2d39a5bbc5e8a6ea26434e842fbb10 (patch) | |
tree | bf834ebc99b749ca6bc16dfbee329097a32efa16 | |
parent | 64f254ccf74242453421d0c495388293dbc06c71 (diff) | |
download | rails-b13400086c2d39a5bbc5e8a6ea26434e842fbb10.tar.gz rails-b13400086c2d39a5bbc5e8a6ea26434e842fbb10.tar.bz2 rails-b13400086c2d39a5bbc5e8a6ea26434e842fbb10.zip |
Add missing inflector dependency
-rw-r--r-- | activesupport/lib/active_support/testing/constant_lookup.rb | 5 | ||||
-rw-r--r-- | activesupport/test/testing/constant_lookup_test.rb | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/testing/constant_lookup.rb b/activesupport/lib/active_support/testing/constant_lookup.rb index 8cb84b3f20..73e87befb6 100644 --- a/activesupport/lib/active_support/testing/constant_lookup.rb +++ b/activesupport/lib/active_support/testing/constant_lookup.rb @@ -1,4 +1,5 @@ require "active_support/concern" +require "active_support/inflector" module ActiveSupport module Testing @@ -33,9 +34,7 @@ module ActiveSupport def determine_constant_from_test_name(test_name) names = test_name.split "::" while names.size > 0 do - names.last.sub! /Test$/, "" - # Rails 3.0 doesn't have safe_constantize, - # so we'll do it the hard way. + names.last.sub!(/Test$/, "") begin constant = names.join("::").constantize break(constant) if yield(constant) diff --git a/activesupport/test/testing/constant_lookup_test.rb b/activesupport/test/testing/constant_lookup_test.rb index f39d38e5cd..d6552b5e49 100644 --- a/activesupport/test/testing/constant_lookup_test.rb +++ b/activesupport/test/testing/constant_lookup_test.rb @@ -8,7 +8,7 @@ end class Baz < Bar; end module FooBar; end -class TestLookup < ActiveSupport::TestCase +class ConstantLookupTest < ActiveSupport::TestCase def find_foo(name) self.class.determine_constant_from_test_name(name) do |constant| |