Module: Lopata::Role::DSL
- Included in:
- ScenarioBuilder
- Defined in:
- lib/lopata/role.rb
Overview
To be included in Lopata::ScenarioBuilder
Instance Method Summary collapse
-
#as(*args, &block) ⇒ Object
Enumerate the roles the scenario to be runned under.
-
#as_first(*args, &block) ⇒ Object
Enumerate the roles the scenario can be run.
-
#without_user ⇒ Object
Marks scenario to be runned without user.
Instance Method Details
#as(*args, &block) ⇒ Object
Enumerate the roles the scenario to be runned under. If not invoked the default role only will be used.
The scenario should be set to use the role via before_scenario step using #current_role param.
45 46 47 48 49 50 |
# File 'lib/lopata/role.rb', line 45 def as(*args, &block) @roles = args.flatten @roles << Lopata::ScenarioBuilder::CalculatedValue.new(&block) if block_given? @use_all_roles = true = nil end |
#as_first(*args, &block) ⇒ Object
Enumerate the roles the scenario can be run.
The scenario should be set to use the role via before_scenario step using #current_role param.
Only first role will be used if scenario has no options or diagonales. Some first roles will be used if options or diagonales are declared, in order of appearence.
Use this to describe possible roles, but not needed to run scenario with all of them in order to save time of running.
63 64 65 66 67 |
# File 'lib/lopata/role.rb', line 63 def as_first(*args, &block) @roles = args.flatten @use_all_roles = false = nil end |
#without_user ⇒ Object
Marks scenario to be runned without user.
83 84 85 |
# File 'lib/lopata/role.rb', line 83 def without_user @without_user = true end |