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:   '-'
}
STATUSES =
FORMATS.keys

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stdout, stderr) ⇒ Console

Returns a new instance of Console.



21
22
23
# File 'lib/flatware/cucumber/formatters/console.rb', line 21

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

Instance Attribute Details

#errObject (readonly)

Returns the value of attribute err.



19
20
21
# File 'lib/flatware/cucumber/formatters/console.rb', line 19

def err
  @err
end

#outObject (readonly)

Returns the value of attribute out.



19
20
21
# File 'lib/flatware/cucumber/formatters/console.rb', line 19

def out
  @out
end

Instance Method Details

#progress(result) ⇒ Object



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

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

#summarize(checkpoints) ⇒ Object



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

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



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

def summarize_remaining(remaining_jobs)
  out.puts
  out.puts "The following features have not been run:"
  for job in remaining_jobs
    out.puts job.id
  end
end