Class: Cucumber::Core::Compiler::FeatureCompiler

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber/core/compiler.rb

Instance Method Summary collapse

Constructor Details

#initialize(receiver) ⇒ FeatureCompiler

Returns a new instance of FeatureCompiler.



69
70
71
# File 'lib/cucumber/core/compiler.rb', line 69

def initialize(receiver)
  @receiver = receiver
end

Instance Method Details

#background(background, &descend) ⇒ Object



79
80
81
82
83
84
# File 'lib/cucumber/core/compiler.rb', line 79

def background(background, &descend)
  source = [@feature, background]
  compiler = BackgroundCompiler.new(source, receiver)
  descend.call(compiler)
  self
end

#feature(feature, &descend) ⇒ Object



73
74
75
76
77
# File 'lib/cucumber/core/compiler.rb', line 73

def feature(feature, &descend)
  @feature = feature
  descend.call(self)
  self
end

#scenario(scenario, &descend) ⇒ Object



86
87
88
89
90
91
92
# File 'lib/cucumber/core/compiler.rb', line 86

def scenario(scenario, &descend)
  source = [@feature, scenario]
  scenario_compiler = ScenarioCompiler.new(source, receiver)
  descend.call(scenario_compiler)
  receiver.on_test_case(source)
  self
end

#scenario_outline(scenario_outline, &descend) ⇒ Object



94
95
96
97
98
99
# File 'lib/cucumber/core/compiler.rb', line 94

def scenario_outline(scenario_outline, &descend)
  source = [@feature, scenario_outline]
  compiler = ScenarioOutlineCompiler.new(source, receiver)
  descend.call(compiler)
  self
end