Class: Catechism::Matchers::Equal
- Defined in:
- lib/catechism/matchers/equal.rb
Instance Attribute Summary collapse
-
#expectation ⇒ Object
Returns the value of attribute expectation.
-
#negated ⇒ Object
Returns the value of attribute negated.
-
#subject ⇒ Object
Returns the value of attribute subject.
Instance Method Summary collapse
Instance Attribute Details
#expectation ⇒ Object
Returns the value of attribute expectation
3 4 5 |
# File 'lib/catechism/matchers/equal.rb', line 3 def expectation @expectation end |
#negated ⇒ Object
Returns the value of attribute negated
3 4 5 |
# File 'lib/catechism/matchers/equal.rb', line 3 def negated @negated end |
#subject ⇒ Object
Returns the value of attribute subject
3 4 5 |
# File 'lib/catechism/matchers/equal.rb', line 3 def subject @subject end |
Instance Method Details
#equal? ⇒ Boolean
4 5 6 |
# File 'lib/catechism/matchers/equal.rb', line 4 def equal? subject == expectation end |
#failure_message ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/catechism/matchers/equal.rb', line 12 def if negated "#{subject} equals #{expected}" else "#{subject} does not equal #{expected}" end end |
#valid? ⇒ Boolean
8 9 10 |
# File 'lib/catechism/matchers/equal.rb', line 8 def valid? equal? ^ negated end |