Module: Cucumber::StepMethods

Defined in:
lib/cucumber/step_methods.rb

Instance Method Summary collapse

Instance Method Details

#After(&proc) ⇒ Object



13
14
15
# File 'lib/cucumber/step_methods.rb', line 13

def After(&proc)
  $executor.register_after_proc(&proc)
end

#Before(&proc) ⇒ Object



9
10
11
# File 'lib/cucumber/step_methods.rb', line 9

def Before(&proc)
  $executor.register_before_proc(&proc)
end

#Given(key, &proc) ⇒ Object



17
18
19
# File 'lib/cucumber/step_methods.rb', line 17

def Given(key, &proc)
  step_mother.register_step_proc(key, &proc)
end

#step_motherObject

:nodoc:



35
36
37
# File 'lib/cucumber/step_methods.rb', line 35

def step_mother #:nodoc:
  @step_mother ||= StepMother.new
end

#steps_for(*_) ⇒ Object

Simple workaround for old skool steps



30
31
32
33
# File 'lib/cucumber/step_methods.rb', line 30

def steps_for(*_)
  STDERR.puts "WARNING: In Cucumber the steps_for method is obsolete"
  yield
end

#Then(key, &proc) ⇒ Object



25
26
27
# File 'lib/cucumber/step_methods.rb', line 25

def Then(key, &proc)
  step_mother.register_step_proc(key, &proc)
end

#When(key, &proc) ⇒ Object



21
22
23
# File 'lib/cucumber/step_methods.rb', line 21

def When(key, &proc)
  step_mother.register_step_proc(key, &proc)
end

#World(&proc) ⇒ Object



5
6
7
# File 'lib/cucumber/step_methods.rb', line 5

def World(&proc)
  $executor.register_world_proc(&proc)
end