Module: MarsoContext

Defined in:
lib/marso/domain/story/story_template.rb,
lib/marso/domain/feature/feature_template.rb,
lib/marso/domain/scenario/scenario_template.rb

Class Method Summary collapse

Class Method Details

.feature(ctx = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/marso/domain/feature/feature_template.rb', line 4

def self.feature(ctx={})
  Marso::Feature.new({
    :id => "#{id}",
    :name => "#{name}",
    :in_order_to => "#{in_order_to}",
    :as_a => "#{as_a}",
    :i => "#{i}"
  })
end

.scenario_context(ctx = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/marso/domain/scenario/scenario_template.rb', line 4

def self.scenario_context(ctx={})
	Marso::ScenarioContext.new({
		:id => "#{id}",
		:before_run => lambda { |id, ctx|
			# Enter the code you want to execute before running the scenario.
			# Uncomment the code below if you want to open a Firefox browser.
			# ctx[:browser] = Marso.openNewBrowser()
		},
		:get_scenario => lambda { |id, ctx|
			Marso::Scenario.new({:id => id, :name => "#{name}"}, ctx)
				.given("#{given}") {
					# TODO: Enter your code here
				}
				.when("#{_when}"){
					# TODO: Enter your code here
				}
				.then("#{_then}"){
					# TODO: Enter your code here
				}
		},
		:after_run => lambda { |id, ctx|
			# Enter the code you want to execute after the scenario is done running.
			# Uncomment the code below if you want to close the Firefox browser.
			# ctx[:browser].close
		}
	}, ctx)
end

.story(ctx = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/marso/domain/story/story_template.rb', line 4

def self.story(ctx={})
  Marso::Story.new({
    :id => "#{id}",
    :name => "#{name}",
    :in_order_to => "#{in_order_to}",
    :as_a => "#{as_a}",
    :i => "#{i}"
  },
  ctx)
end