Class: Flatware::RSpec::Formatters::Console
- Inherits:
-
Object
- Object
- Flatware::RSpec::Formatters::Console
- Defined in:
- lib/flatware/rspec/formatters/console.rb
Instance Attribute Summary collapse
-
#formatter ⇒ Object
readonly
Returns the value of attribute formatter.
Instance Method Summary collapse
-
#initialize(out, err) ⇒ Console
constructor
A new instance of Console.
- #progress(result) ⇒ Object
- #summarize(checkpoints) ⇒ Object
Constructor Details
#initialize(out, err) ⇒ Console
Returns a new instance of Console.
5 6 7 8 9 |
# File 'lib/flatware/rspec/formatters/console.rb', line 5 def initialize(out, err) ::RSpec::configuration.tty = true ::RSpec::configuration.color = true @formatter = ::RSpec::Core::Formatters::ProgressFormatter.new(out) end |
Instance Attribute Details
#formatter ⇒ Object (readonly)
Returns the value of attribute formatter.
3 4 5 |
# File 'lib/flatware/rspec/formatters/console.rb', line 3 def formatter @formatter end |
Instance Method Details
#progress(result) ⇒ Object
11 12 13 |
# File 'lib/flatware/rspec/formatters/console.rb', line 11 def progress(result) formatter.send((result),nil) end |
#summarize(checkpoints) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/flatware/rspec/formatters/console.rb', line 15 def summarize(checkpoints) result = checkpoints.reduce :+ if result formatter.dump_failures result formatter.dump_summary result.summary end end |