Class: Gurke::Background

Inherits:
Object
  • Object
show all
Defined in:
lib/gurke/background.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file, line, raw) ⇒ Background

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Background.



28
29
30
31
32
33
# File 'lib/gurke/background.rb', line 28

def initialize(file, line, raw)
  @file  = file
  @line  = line
  @raw   = raw
  @steps = RunList.new
end

Instance Attribute Details

#fileString (readonly)

Return path to file containing this background.

Returns:

  • (String)

    File path.



10
11
12
# File 'lib/gurke/background.rb', line 10

def file
  @file
end

#lineFixnum (readonly)

Return line number where this background is defined.

Returns:

  • (Fixnum)

    Line number.



16
17
18
# File 'lib/gurke/background.rb', line 16

def line
  @line
end

#rawObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



25
26
27
# File 'lib/gurke/background.rb', line 25

def raw
  @raw
end

#stepsArray<Step> (readonly)

List of steps this background specifies.

Returns:

  • (Array<Step>)

    Steps.



22
23
24
# File 'lib/gurke/background.rb', line 22

def steps
  @steps
end

Instance Method Details

#run(runner, reporter, scenario, world) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



37
38
39
40
41
42
43
# File 'lib/gurke/background.rb', line 37

def run(runner, reporter, scenario, world)
  reporter.invoke :start_background, self, scenario

  steps.run runner, reporter, scenario, world
ensure
  reporter.invoke :end_background, self, scenario
end