Class: Linepipe::Step::StepExpectation
- Inherits:
-
Object
- Object
- Linepipe::Step::StepExpectation
- Defined in:
- lib/linepipe/step.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(name = nil, &test) ⇒ StepExpectation
constructor
A new instance of StepExpectation.
- #verify(data) ⇒ Object
Constructor Details
#initialize(name = nil, &test) ⇒ StepExpectation
Returns a new instance of StepExpectation.
29 30 31 32 33 |
# File 'lib/linepipe/step.rb', line 29 def initialize(name=nil, &test) @name = name @test = test @status = 'not run' end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
27 28 29 |
# File 'lib/linepipe/step.rb', line 27 def name @name end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
27 28 29 |
# File 'lib/linepipe/step.rb', line 27 def status @status end |
Instance Method Details
#verify(data) ⇒ Object
35 36 37 |
# File 'lib/linepipe/step.rb', line 35 def verify(data) @status = @test.call(data) ? 'pass' : 'fail' end |