Class: Linepipe::Step::StepExpectation

Inherits:
Object
  • Object
show all
Defined in:
lib/linepipe/step.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (readonly)

Returns the value of attribute name.



27
28
29
# File 'lib/linepipe/step.rb', line 27

def name
  @name
end

#statusObject (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