Class: RTest::Expect
- Inherits:
-
Object
- Object
- RTest::Expect
- Defined in:
- lib/rtest/expect.rb
Instance Attribute Summary collapse
-
#failure_message ⇒ Object
readonly
Returns the value of attribute failure_message.
-
#passing_message ⇒ Object
readonly
Returns the value of attribute passing_message.
Instance Method Summary collapse
-
#initialize(object) ⇒ Expect
constructor
A new instance of Expect.
- #not_to(matcher) ⇒ Object
- #pass? ⇒ Boolean
- #to(matcher) ⇒ Object
Constructor Details
#initialize(object) ⇒ Expect
Returns a new instance of Expect.
6 7 8 |
# File 'lib/rtest/expect.rb', line 6 def initialize(object) @object = object end |
Instance Attribute Details
#failure_message ⇒ Object (readonly)
Returns the value of attribute failure_message.
4 5 6 |
# File 'lib/rtest/expect.rb', line 4 def end |
#passing_message ⇒ Object (readonly)
Returns the value of attribute passing_message.
4 5 6 |
# File 'lib/rtest/expect.rb', line 4 def end |
Instance Method Details
#not_to(matcher) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/rtest/expect.rb', line 18 def not_to(matcher) if(matcher.match?(@object)) then = matcher. else = matcher. @pass = true end end |
#pass? ⇒ Boolean
26 27 28 |
# File 'lib/rtest/expect.rb', line 26 def pass? @pass end |
#to(matcher) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/rtest/expect.rb', line 10 def to(matcher) if(matcher.match?(@object)) @pass = true = matcher. else = matcher. end end |