Class: Ubazu::Rspec::Matchers::ActiveRecord::ValidationMatcher
- Inherits:
-
Object
- Object
- Ubazu::Rspec::Matchers::ActiveRecord::ValidationMatcher
- Defined in:
- lib/ubazu/rspec/matchers/active_record/validation_matcher.rb
Overview
:nodoc:
Direct Known Subclasses
Instance Attribute Summary collapse
-
#failure_message ⇒ Object
readonly
Returns the value of attribute failure_message.
Instance Method Summary collapse
-
#initialize(attribute) ⇒ ValidationMatcher
constructor
A new instance of ValidationMatcher.
- #matches?(subject) ⇒ Boolean
- #negative_failure_message ⇒ Object
Constructor Details
#initialize(attribute) ⇒ ValidationMatcher
Returns a new instance of ValidationMatcher.
10 11 12 |
# File 'lib/ubazu/rspec/matchers/active_record/validation_matcher.rb', line 10 def initialize(attribute) @attribute = attribute end |
Instance Attribute Details
#failure_message ⇒ Object (readonly)
Returns the value of attribute failure_message.
8 9 10 |
# File 'lib/ubazu/rspec/matchers/active_record/validation_matcher.rb', line 8 def @failure_message end |
Instance Method Details
#matches?(subject) ⇒ Boolean
18 19 20 21 |
# File 'lib/ubazu/rspec/matchers/active_record/validation_matcher.rb', line 18 def matches?(subject) @subject = subject false end |
#negative_failure_message ⇒ Object
14 15 16 |
# File 'lib/ubazu/rspec/matchers/active_record/validation_matcher.rb', line 14 def @negative_failure_message || @failure_message end |