Permalink
Browse files

Add missing inflector dependency

  • Loading branch information...
1 parent 64f254c commit b13400086c2d39a5bbc5e8a6ea26434e842fbb10 @blowmage blowmage committed Sep 25, 2012
@@ -1,4 +1,5 @@
require "active_support/concern"
+require "active_support/inflector"
module ActiveSupport
module Testing
@@ -33,9 +34,7 @@ module ClassMethods
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)
@@ -8,7 +8,7 @@ def self.index; 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|

0 comments on commit b134000

Please sign in to comment.