Class: Shoulda::Matchers::MatcherContext
- Inherits:
-
Object
- Object
- Shoulda::Matchers::MatcherContext
Instance Attribute Summary (collapse)
-
- (Object) context
readonly
protected
Returns the value of attribute context.
Instance Method Summary (collapse)
-
- (MatcherContext) initialize(context)
constructor
A new instance of MatcherContext.
- - (Boolean) subject_is_a_class?
Constructor Details
- (MatcherContext) initialize(context)
4 5 6 |
# File 'lib/shoulda/matchers/matcher_context.rb', line 4 def initialize(context) @context = context end |
Instance Attribute Details
- (Object) context (readonly, protected)
Returns the value of attribute context
18 19 20 |
# File 'lib/shoulda/matchers/matcher_context.rb', line 18 def context @context end |
Instance Method Details
- (Boolean) subject_is_a_class?
8 9 10 11 12 13 14 |
# File 'lib/shoulda/matchers/matcher_context.rb', line 8 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 |