Class: Cucumber::Value::ValueTester
- Inherits:
-
Object
- Object
- Cucumber::Value::ValueTester
- Defined in:
- lib/cucumber/value/value_tester.rb
Overview
Instance Method Summary collapse
-
#initialize(test) ⇒ ValueTester
constructor
Initialises the ValueTester.
-
#run_test ⇒ Object
Runs the test block.
-
#value? ⇒ Boolean
Getter for whether the value has been delivered.
Constructor Details
#initialize(test) ⇒ ValueTester
Initialises the ValueTester
7 8 9 |
# File 'lib/cucumber/value/value_tester.rb', line 7 def initialize(test) @test = test end |
Instance Method Details
#run_test ⇒ Object
Runs the test block
11 12 13 14 15 16 17 18 |
# File 'lib/cucumber/value/value_tester.rb', line 11 def run_test begin @value = eval @test rescue Exception => exc # TODO: something sensible when tests aren't valid @value = false end end |
#value? ⇒ Boolean
Getter for whether the value has been delivered
21 22 23 |
# File 'lib/cucumber/value/value_tester.rb', line 21 def value? @value end |