Class: Cucumber::Core::Test::Mapping
- Inherits:
-
Object
- Object
- Cucumber::Core::Test::Mapping
- Defined in:
- lib/cucumber/core/test/mapping.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(&block) ⇒ Mapping
constructor
A new instance of Mapping.
- #skip ⇒ Object
Constructor Details
#initialize(&block) ⇒ Mapping
Returns a new instance of Mapping.
10 11 12 13 14 |
# File 'lib/cucumber/core/test/mapping.rb', line 10 def initialize(&block) raise ArgumentError, "Passing a block to execute the mapping is mandatory." unless block @block = block @timer = Timer.new end |
Instance Method Details
#execute ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/cucumber/core/test/mapping.rb', line 20 def execute @timer.start @block.call passed rescue Result::Pending => exception pending(exception) rescue Exception => exception failed(exception) end |
#skip ⇒ Object
16 17 18 |
# File 'lib/cucumber/core/test/mapping.rb', line 16 def skip skipped end |