Commits

Mike Moore committed b134000

Add missing inflector dependency

Comments (0)

Files changed (2)

activesupport/lib/active_support/testing/constant_lookup.rb

 require "active_support/concern"
+require "active_support/inflector"
 
 module ActiveSupport
   module Testing
         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)

activesupport/test/testing/constant_lookup_test.rb

 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|