Class: Mspec::Expect
- Inherits:
-
Object
- Object
- Mspec::Expect
- Defined in:
- lib/m-spec/core/expect.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value) ⇒ Expect
constructor
A new instance of Expect.
- #to(matcher) ⇒ Object
Constructor Details
#initialize(value) ⇒ Expect
5 6 7 |
# File 'lib/m-spec/core/expect.rb', line 5 def initialize(value) @value = value end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
3 4 5 |
# File 'lib/m-spec/core/expect.rb', line 3 def value @value end |
Instance Method Details
#to(matcher) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/m-spec/core/expect.rb', line 9 def to(matcher) begin raise SpecError.new unless matcher.check(@value) rescue SpecError => e data = e end SpecResult.new(self, matcher, data) end |