Class: Plyushkin::Test::HoardedAttributeMatcher::OfTypeMatcher
- Inherits:
-
Object
- Object
- Plyushkin::Test::HoardedAttributeMatcher::OfTypeMatcher
- Defined in:
- lib/plyushkin/test/hoarded_attribute_matcher.rb
Instance Method Summary collapse
- #failure_message ⇒ Object
-
#initialize(attr_name, type) ⇒ OfTypeMatcher
constructor
A new instance of OfTypeMatcher.
- #match(subject) ⇒ Object
- #negative_failure_message ⇒ Object
Constructor Details
#initialize(attr_name, type) ⇒ OfTypeMatcher
Returns a new instance of OfTypeMatcher.
31 32 33 |
# File 'lib/plyushkin/test/hoarded_attribute_matcher.rb', line 31 def initialize(attr_name, type) @attr_name, @type = attr_name, type end |
Instance Method Details
#failure_message ⇒ Object
39 40 41 |
# File 'lib/plyushkin/test/hoarded_attribute_matcher.rb', line 39 def (false) end |
#match(subject) ⇒ Object
35 36 37 |
# File 'lib/plyushkin/test/hoarded_attribute_matcher.rb', line 35 def match(subject) subject.class.plyushkin_model.registered_types[@attr_name] == @type end |
#negative_failure_message ⇒ Object
43 44 45 |
# File 'lib/plyushkin/test/hoarded_attribute_matcher.rb', line 43 def (true) end |