[DRE-commits] [ruby-rspec-instafail] 22/126: make rspec 1.x look like miwillhite made rspec 2.x look

Hideki Yamane henrich at moszumanska.debian.org
Sun Nov 15 19:15:00 UTC 2015


This is an automated email from the git hooks/post-receive script.

henrich pushed a commit to branch debian/sid
in repository ruby-rspec-instafail.

commit 6f3cb4d2ca9cc2f9a5c5324f5765bc49b4d5002f
Author: grosser <grosser.michael at gmail.com>
Date:   Fri Oct 22 20:13:14 2010 +0200

    make rspec 1.x look like miwillhite made rspec 2.x look
---
 lib/rspec/instafail.rb | 25 ++++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git a/lib/rspec/instafail.rb b/lib/rspec/instafail.rb
index f9eec5b..aef8196 100644
--- a/lib/rspec/instafail.rb
+++ b/lib/rspec/instafail.rb
@@ -4,11 +4,26 @@ module RSpec
     require 'spec/runner/formatter/progress_bar_formatter'
     class Instafail < Spec::Runner::Formatter::ProgressBarFormatter
       def example_failed(example, counter, failure)
+        short_padding = '  '
+        padding = '     '
+
         output.puts
-        output.puts red("#{counter}: #{example_group.description} #{example.description}")
-        output.puts " -> #{failure.exception}"
+        output.puts red("#{short_padding}#{counter}) #{example_group.description} #{example.description}")
+        output.puts "#{padding}#{red(failure.exception)}"
+
+        format_backtrace(failure.exception.backtrace).each do |backtrace_info|
+          output.puts insta_gray("#{padding}# #{backtrace_info.strip}")
+        end
+
         output.flush
       end
+
+      private
+
+      # there is a gray() that returns nil, so we use our own...
+      def insta_gray(text)
+        colour(text, "\e[90m")
+      end
     end
     Instafail
   else
@@ -19,16 +34,20 @@ module RSpec
       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
@@ -36,4 +55,4 @@ module RSpec
   end
 
   klass::VERSION = File.read( File.join(File.dirname(__FILE__),'..','..','VERSION') ).strip
-end
\ No newline at end of file
+end

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-rspec-instafail.git



More information about the Pkg-ruby-extras-commits mailing list