Class: Catechism::SubjectWrapper
- Defined in:
- lib/catechism/subject_wrapper.rb
Instance Attribute Summary collapse
-
#negated ⇒ Object
readonly
Returns the value of attribute negated.
-
#subject ⇒ Object
Returns the value of attribute subject.
Instance Method Summary collapse
- #not ⇒ Object
- #to_be_nil ⇒ Object
- #to_equal(expected) ⇒ Object
- #to_raise_error ⇒ Object
- #to_send(method_name) ⇒ Object
Instance Attribute Details
#negated ⇒ Object (readonly)
Returns the value of attribute negated.
6 7 8 |
# File 'lib/catechism/subject_wrapper.rb', line 6 def negated @negated end |
#subject ⇒ Object
Returns the value of attribute subject
5 6 7 |
# File 'lib/catechism/subject_wrapper.rb', line 5 def subject @subject end |
Instance Method Details
#not ⇒ Object
27 28 29 30 |
# File 'lib/catechism/subject_wrapper.rb', line 27 def not @negated = true self end |
#to_be_nil ⇒ Object
13 14 15 16 |
# File 'lib/catechism/subject_wrapper.rb', line 13 def to_be_nil matcher = Catechism::Matchers::Equal.new(subject, nil, negated) raise matcher. unless matcher.valid? end |
#to_equal(expected) ⇒ Object
8 9 10 11 |
# File 'lib/catechism/subject_wrapper.rb', line 8 def to_equal(expected) matcher = Catechism::Matchers::Equal.new(subject, expected, negated) raise matcher. unless matcher.valid? end |
#to_raise_error ⇒ Object
18 19 20 21 |
# File 'lib/catechism/subject_wrapper.rb', line 18 def to_raise_error matcher = Catechism::Matchers::RaiseError.new(subject, negated) raise matcher. unless matcher.valid? end |