Class: Cucumber::Core::Test::HookStep

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

Instance Method Summary collapse

Constructor Details

#initialize(source, &block) ⇒ HookStep

Returns a new instance of HookStep.



7
8
9
10
# File 'lib/cucumber/core/test/hook_compiler.rb', line 7

def initialize(source, &block)
  @mapping = Test::Mapping.new(&block)
  @source = source
end

Instance Method Details

#describe_source_to(visitor, *args) ⇒ Object



16
17
18
# File 'lib/cucumber/core/test/hook_compiler.rb', line 16

def describe_source_to(visitor, *args)
  visitor.hook(*args)
end

#describe_to(visitor, *args) ⇒ Object



12
13
14
# File 'lib/cucumber/core/test/hook_compiler.rb', line 12

def describe_to(visitor, *args)
  visitor.test_step(self, *args)
end

#executeObject



20
21
22
# File 'lib/cucumber/core/test/hook_compiler.rb', line 20

def execute
  @mapping.execute
end

#inspectObject



36
37
38
# File 'lib/cucumber/core/test/hook_compiler.rb', line 36

def inspect
  "#{self.class}"
end

#mapObject



28
29
30
# File 'lib/cucumber/core/test/hook_compiler.rb', line 28

def map
  self
end

#match_locations?(locations) ⇒ Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/cucumber/core/test/hook_compiler.rb', line 32

def match_locations?(locations)
  false
end

#skipObject



24
25
26
# File 'lib/cucumber/core/test/hook_compiler.rb', line 24

def skip
  execute
end