Sha256: b8b731d9cbdc7abd57a34109862affa6d3080a61aa861049a5350404a0cf1dd5

Contents?: true

Size: 762 Bytes

Versions: 9

Compression:

Stored size: 762 Bytes

Contents

require 'rspec/core/formatters/progress_formatter'

module RSpec
  class Instafail < RSpec::Core::Formatters::ProgressFormatter
    def example_failed(example)
      @counter ||= 0
      @counter += 1
      exception = example.metadata[:execution_result][:exception_encountered]
      short_padding = '  '
      padding = '     '
      output.puts
      output.puts "#{short_padding}#{@counter}) #{example.full_description}"
      output.puts "#{padding}#{red("Failure/Error:")} #{red(read_failed_line(exception, example).strip)}"
      output.puts "#{padding}#{red(exception)}"
      format_backtrace(exception.backtrace, example).each do |backtrace_info|
        output.puts grey("#{padding}# #{backtrace_info}")
      end
      output.flush
    end
  end
end

Version data entries

9 entries across 9 versions & 3 rubygems

Version Path
vim-jar-0.1.2.0001 bundler/ruby/1.8/gems/rspec-instafail-0.1.4/lib/rspec/instafail/rspec_2.rb
vim-jar-0.1.2 bundler/ruby/1.8/gems/rspec-instafail-0.1.4/lib/rspec/instafail/rspec_2.rb
vim-jar-0.1.1 bundler/ruby/1.8/gems/rspec-instafail-0.1.4/lib/rspec/instafail/rspec_2.rb
vim-jar-0.1.0 bundler/ruby/1.8/gems/rspec-instafail-0.1.4/lib/rspec/instafail/rspec_2.rb
vim-jar-0.0.3 bundler/ruby/1.8/gems/rspec-instafail-0.1.4/lib/rspec/instafail/rspec_2.rb
nimboids-rspec-instafail-0.1.3 lib/rspec/instafail/rspec_2.rb
vim-jar-0.0.2 bundler/ruby/1.8/gems/rspec-instafail-0.1.4/lib/rspec/instafail/rspec_2.rb
vim-jar-0.0.1 bundler/ruby/1.8/gems/rspec-instafail-0.1.4/lib/rspec/instafail/rspec_2.rb
rspec-instafail-0.1.4 lib/rspec/instafail/rspec_2.rb