Class: Cucumber::Formatter::HookQueryVisitor

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber/formatter/hook_query_visitor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(test_step) ⇒ HookQueryVisitor

Returns a new instance of HookQueryVisitor.



6
7
8
9
10
# File 'lib/cucumber/formatter/hook_query_visitor.rb', line 6

def initialize(test_step)
  @hook = false
  @type = :no_hook
  test_step.source.last.describe_to(self)
end

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



4
5
6
# File 'lib/cucumber/formatter/hook_query_visitor.rb', line 4

def type
  @type
end

Instance Method Details

#after_hookObject



24
25
26
27
# File 'lib/cucumber/formatter/hook_query_visitor.rb', line 24

def after_hook(*)
  @hook = true
  @type = :after
end

#after_step_hookObject



29
30
31
32
# File 'lib/cucumber/formatter/hook_query_visitor.rb', line 29

def after_step_hook(*)
  @hook = true
  @type = :after_step
end

#around_hookObject



34
35
36
37
# File 'lib/cucumber/formatter/hook_query_visitor.rb', line 34

def around_hook(*)
  @hook = true
  @type = :around
end

#before_hookObject



19
20
21
22
# File 'lib/cucumber/formatter/hook_query_visitor.rb', line 19

def before_hook(*)
  @hook = true
  @type = :before
end

#hook?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/cucumber/formatter/hook_query_visitor.rb', line 12

def hook?
  @hook
end

#stepObject



16
17
# File 'lib/cucumber/formatter/hook_query_visitor.rb', line 16

def step(*)
end