Method: Minitest::Spec::DSL#spec_type
- Defined in:
- lib/minitest/spec.rb
permalink #spec_type(desc, *additional) ⇒ Object
Figure out the spec class to use based on a spec’s description. Eg:
spec_type("BlahController") # => Minitest::Spec::Rails
161 162 163 164 165 166 167 168 169 |
# File 'lib/minitest/spec.rb', line 161 def spec_type desc, *additional TYPES.find { |matcher, _klass| if matcher.respond_to? :call then matcher.call desc, *additional else matcher === desc.to_s end }.last end |