Class: Flatware::Cucumber::Formatters::Console

Inherits:
Object
  • Object
show all
Includes:
Cucumber::Formatter::Console
Defined in:
lib/flatware/cucumber/formatters/console.rb,
lib/flatware/cucumber/formatters/console/summary.rb

Defined Under Namespace

Classes: Summary

Constant Summary collapse

FORMATS =
{
  passed: '.',
  failed: 'F',
  undefined: 'U',
  pending: 'P',
  skipped: '-'
}.freeze
STATUSES =
FORMATS.keys

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stdout, stderr) ⇒ Console

Returns a new instance of Console.



25
26
27
28
# File 'lib/flatware/cucumber/formatters/console.rb', line 25

def initialize(stdout, stderr)
  @out = stdout
  @err = stderr
end

Instance Attribute Details

#errObject (readonly)

Returns the value of attribute err.



23
24
25
# File 'lib/flatware/cucumber/formatters/console.rb', line 23

def err
  @err
end

#outObject (readonly)

Returns the value of attribute out.



23
24
25
# File 'lib/flatware/cucumber/formatters/console.rb', line 23

def out
  @out
end

Instance Method Details

#progress(result) ⇒ Object



30
31
32
# File 'lib/flatware/cucumber/formatters/console.rb', line 30

def progress(result)
  out.print format result.progress
end

#summarize(checkpoints) ⇒ Object



34
35
36
37
38
# File 'lib/flatware/cucumber/formatters/console.rb', line 34

def summarize(checkpoints)
  steps = checkpoints.flat_map(&:steps)
  scenarios = checkpoints.flat_map(&:scenarios)
  Summary.new(steps, scenarios, out).summarize
end

#summarize_remaining(remaining_jobs) ⇒ Object



40
41
42
43
44
45
46
# File 'lib/flatware/cucumber/formatters/console.rb', line 40

def summarize_remaining(remaining_jobs)
  out.puts
  out.puts 'The following features have not been run:'
  remaining_jobs.each do |job|
    out.puts job.id
  end
end