Class: Shoulda::Matchers::MatcherContext
- Inherits:
-
Object
- Object
- Shoulda::Matchers::MatcherContext
- Defined in:
- lib/shoulda/matchers/matcher_context.rb
Instance Method Summary collapse
-
#initialize(context) ⇒ MatcherContext
constructor
A new instance of MatcherContext.
- #subject_is_a_class? ⇒ Boolean
Constructor Details
#initialize(context) ⇒ MatcherContext
Returns a new instance of MatcherContext.
5 6 7 |
# File 'lib/shoulda/matchers/matcher_context.rb', line 5 def initialize(context) @context = context end |
Instance Method Details
#subject_is_a_class? ⇒ Boolean
9 10 11 12 13 14 15 |
# File 'lib/shoulda/matchers/matcher_context.rb', line 9 def subject_is_a_class? if inside_a_shoulda_context_project? && outside_a_should_block? assume_that_subject_is_not_a_class else context.subject.is_a?(Class) end end |