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.



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

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.



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

def type
  @type
end

Instance Method Details

#after_hookObject



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

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

#after_step_hookObject



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

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

#around_hookObject



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

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

#before_hookObject



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

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

#hook?Boolean

Returns:

  • (Boolean)


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

def hook?
  @hook
end

#stepObject



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

def step(*)
end