Class: Nyan::Formatter
- Inherits:
-
RSpec::Core::Formatters::BaseTextFormatter
- Object
- RSpec::Core::Formatters::BaseTextFormatter
- Nyan::Formatter
- Defined in:
- lib/nyan/formatter.rb
Instance Method Summary collapse
- #dump_backtrace(example) ⇒ Object
- #dump_failures ⇒ Object
- #example_failed(example) ⇒ Object
- #example_passed(_) ⇒ Object
-
#initialize(*args) ⇒ Formatter
constructor
A new instance of Formatter.
Constructor Details
Instance Method Details
#dump_backtrace(example) ⇒ Object
37 38 39 40 41 |
# File 'lib/nyan/formatter.rb', line 37 def dump_backtrace(example) format_backtrace(example.execution_result[:exception].backtrace, example).each do |backtrace_info| output.puts cyan(" # #{backtrace_info}") end end |
#dump_failures ⇒ Object
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/nyan/formatter.rb', line 26 def dump_failures return if failed_examples.empty? output.puts output.puts "Failures:" failed_examples.each_with_index do |example, index| output.puts dump_pending_example_fixed(example, index) || dump_failure(example, index) dump_backtrace(example) end end |
#example_failed(example) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/nyan/formatter.rb', line 18 def example_failed(example) super @output.print cls @output.print move(0,0) @output.puts red("NO NYAN FOR YOU") @still_passing = false end |
#example_passed(_) ⇒ Object
14 15 16 |
# File 'lib/nyan/formatter.rb', line 14 def example_passed(_) @nyan_flight.next! if @still_passing end |