Module: TurnipFormatter

Defined in:
lib/turnip_formatter.rb,
lib/turnip_formatter/step.rb,
lib/turnip_formatter/helper.rb,
lib/turnip_formatter/printer.rb,
lib/turnip_formatter/version.rb,
lib/turnip_formatter/template.rb,
lib/turnip_formatter/printer/step.rb,
lib/turnip_formatter/printer/index.rb,
lib/turnip_formatter/scenario/base.rb,
lib/turnip_formatter/scenario/pass.rb,
lib/turnip_formatter/printer/scenario.rb,
lib/turnip_formatter/scenario/failure.rb,
lib/turnip_formatter/scenario/pending.rb,
lib/turnip_formatter/step_template/base.rb,
lib/turnip_formatter/step_template/source.rb,
lib/turnip_formatter/printer/runtime_error.rb,
lib/turnip_formatter/printer/step_extra_args.rb,
lib/turnip_formatter/step_template/exception.rb,
lib/turnip_formatter/printer/tab_tag_statistics.rb,
lib/turnip_formatter/printer/tab_speed_statistics.rb,
lib/turnip_formatter/printer/tab_feature_statistics.rb

Defined Under Namespace

Modules: Helper, Printer, Scenario, StepTemplate Classes: Step, Template

Constant Summary collapse

VERSION =
'0.3.4'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.titleObject

Returns the value of attribute title.



6
7
8
# File 'lib/turnip_formatter.rb', line 6

def title
  @title
end

Class Method Details

.add_javascript(scripts) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/turnip_formatter.rb', line 28

def add_javascript(scripts)
  scripts = [scripts] if scripts.is_a? String

  scripts.each do |s|
    TurnipFormatter::Template.add_javascript(s)
  end
end

.add_stylesheet(stylesheets) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/turnip_formatter.rb', line 20

def add_stylesheet(stylesheets)
  stylesheets = [stylesheets] if stylesheets.is_a? String

  stylesheets.each do |s|
    TurnipFormatter::Template.add_stylesheet(s)
  end
end

.configurationObject



40
41
42
# File 'lib/turnip_formatter.rb', line 40

def configuration
  self
end

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



36
37
38
# File 'lib/turnip_formatter.rb', line 36

def configure
  yield self
end

.step_templatesObject



8
9
10
# File 'lib/turnip_formatter.rb', line 8

def step_templates
  @step_templates ||= []
end

.step_templates_for(status) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/turnip_formatter.rb', line 12

def step_templates_for(status)
  step_templates.reduce([]) do |templates, t|
    hooks = t.class.hooks
    return templates unless hooks.key?(status)
    templates + [t].product(hooks[status])
  end
end