mcmire-protest 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/protest.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Protest
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
 
4
4
  # Exception raised when an assertion fails. See TestCase#assert
5
5
  class AssertionFailed < StandardError; end
@@ -71,10 +71,12 @@ module Protest
71
71
  pad_indexes = failures_and_errors.size.to_s.size
72
72
  failures_and_errors.each_with_index do |error, index|
73
73
  colorize_as = ErroredTest === error ? :errored : :failed
74
- puts " #{pad(index+1, pad_indexes)}) #{test_type(error)}: `#{error.test_name}' (on line #{error.line} of `#{error.file}')", colorize_as
74
+ puts " #{pad(index+1, pad_indexes)}) #{test_type(error)} in `#{error.test.class.description} #{error.test_name}' (on line #{error.line} of `#{error.file}')", colorize_as
75
75
  # If error message has line breaks, indent the message
76
76
  prefix = "with"
77
- prefix << " #{error.error.class}" unless Protest::AssertionFailed === error.error
77
+ unless error.error.is_a?(Protest::AssertionFailed) || error.error.is_a?(::Test::Unit::AssertionFailedError)
78
+ prefix << " #{error.error.class}"
79
+ end
78
80
  if error.error_message =~ /\n/
79
81
  puts indent("#{prefix}: <<", 6 + pad_indexes), colorize_as
80
82
  puts indent(error.error_message, 6 + pad_indexes + 2), colorize_as
@@ -82,7 +84,7 @@ module Protest
82
84
  else
83
85
  puts indent("#{prefix} `#{error.error_message}'", 6 + pad_indexes), colorize_as
84
86
  end
85
- indent(error.backtrace, 6 + pad_indexes).each {|backtrace| puts backtrace, colorize_as }
87
+ indent(error.backtrace[1..-1], 6 + pad_indexes).each {|backtrace| puts backtrace, colorize_as }
86
88
  puts
87
89
  end
88
90
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "mcmire-protest"
3
- s.version = "0.3.0"
3
+ s.version = "0.3.1"
4
4
  s.date = "2010-01-10"
5
5
 
6
6
  s.description = "Protest is a tiny, simple, and easy-to-extend test framework"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mcmire-protest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Nicol\xC3\xA1s Sanguinetti"