Class: Lopata::Scenario
- Inherits:
-
Object
- Object
- Lopata::Scenario
- Includes:
- ActiveRecord::Methods, FactoryBot::Methods, Role::Methods, RSpec::Matchers
- Defined in:
- lib/lopata/scenario.rb
Overview
Scenario runtime class.
All the scenarios are running in context of separate Lopata::Scenario object.
Instance Method Summary collapse
-
#inspect ⇒ Object
(also: #to_s)
Provide a human-readable representation of this class.
-
#metadata ⇒ Hash
Metadata available for current step.
-
#pending(message = nil) ⇒ Object
Marks current step as pending Pending steps wont be failed.
Methods included from Role::Methods
Methods included from ActiveRecord::Methods
#cleanup, #cleanup_later, #find_created, #reload
Methods included from FactoryBot::Methods
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object (private)
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/lopata/scenario.rb', line 47 def method_missing(method, *args, &block) if (let_method = execution.find_let_method(method)) let_method.call_in_scenario(self, *args) elsif .keys.include?(method) [method] else super end end |
Instance Method Details
#inspect ⇒ Object Also known as: to_s
Provide a human-readable representation of this class
19 20 21 |
# File 'lib/lopata/scenario.rb', line 19 def inspect "#<#{self.class.name} #{execution.title.inspect}>" end |
#metadata ⇒ Hash
Note:
The metadata keys also availalbe as methods (via method_missing)
Returns metadata available for current step.
40 41 42 |
# File 'lib/lopata/scenario.rb', line 40 def execution. end |
#pending(message = nil) ⇒ Object
Marks current step as pending Pending steps wont be failed
34 35 36 |
# File 'lib/lopata/scenario.rb', line 34 def pending( = nil) execution.current_step.pending!() end |