123456789_123456789_123456789_123456789_123456789_

Module: ActiveSupport::Testing::ConstantLookup::ClassMethods

Do not use. This module is for internal use only.
Relationships & Source Files
Defined in: activesupport/lib/active_support/testing/constant_lookup.rb

Instance Method Summary

Instance Method Details

#determine_constant_from_test_name(test_name)

[ GitHub ]

  
# File 'activesupport/lib/active_support/testing/constant_lookup.rb', line 36

def determine_constant_from_test_name(test_name)
  names = test_name.split "::"
  while names.size > 0 do
    names.last.sub!(/Test$/, "")
    begin
      constant = names.join("::").safe_constantize
      break(constant) if yield(constant)
    ensure
      names.pop
    end
  end
end