Class: Cucumber::Core::Test::Action
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-core-11.0.0/lib/cucumber/core/test/action.rb
Direct Known Subclasses
Instance Method Summary collapse
- #execute(*args) ⇒ Object
-
#initialize(location = nil, &block) ⇒ Action
constructor
A new instance of Action.
- #inspect ⇒ Object
- #location ⇒ Object
- #skip ⇒ Object
Constructor Details
#initialize(location = nil, &block) ⇒ Action
Returns a new instance of Action.
10 11 12 13 14 15 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-core-11.0.0/lib/cucumber/core/test/action.rb', line 10 def initialize(location = nil, &block) raise ArgumentError, "Passing a block to execute the action is mandatory." unless block @location = location ? location : Test::Location.new(*block.source_location) @block = block @timer = Timer.new end |
Instance Method Details
#execute(*args) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-core-11.0.0/lib/cucumber/core/test/action.rb', line 21 def execute(*args) @timer.start @block.call(*args) passed rescue Result::Raisable => exception exception.with_duration(@timer.duration) rescue Exception => exception failed(exception) end |
#inspect ⇒ Object
35 36 37 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-core-11.0.0/lib/cucumber/core/test/action.rb', line 35 def inspect "#<#{self.class}: #{location}>" end |
#location ⇒ Object
31 32 33 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-core-11.0.0/lib/cucumber/core/test/action.rb', line 31 def location @location end |
#skip ⇒ Object
17 18 19 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-core-11.0.0/lib/cucumber/core/test/action.rb', line 17 def skip(*) skipped end |