1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #7759 from blowmage/minitest

Add missing inflector dependency
This commit is contained in:
Aaron Patterson 2012-09-25 14:42:28 -07:00
commit 267c3d0f14
2 changed files with 3 additions and 4 deletions

View file

@ -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)

View file

@ -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|