mcmire-protest 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -15,7 +15,7 @@ end
15
15
 
16
16
  begin
17
17
  require "mg"
18
- MG.new("protest.gemspec")
18
+ MG.new("mcmire-protest.gemspec")
19
19
  rescue LoadError
20
20
  end
21
21
 
@@ -120,6 +120,10 @@ module Protest
120
120
  # new context. This method is aliased as +describe+ for your comfort.
121
121
  def self.context(description, &block)
122
122
  subclass = Class.new(self)
123
+ (class << subclass; self; end).class_eval do
124
+ def do_global_setup; end
125
+ def do_global_teardown; end
126
+ end
123
127
  subclass.class_eval(&block) if block
124
128
  subclass.description = description
125
129
  const_set(sanitize_description(description), subclass)
@@ -73,14 +73,16 @@ module Protest
73
73
  colorize_as = ErroredTest === error ? :errored : :failed
74
74
  puts " #{pad(index+1, pad_indexes)}) #{test_type(error)}: `#{error.test_name}' (on line #{error.line} of `#{error.file}')", colorize_as
75
75
  # If error message has line breaks, indent the message
76
+ prefix = "with"
77
+ prefix << " #{error.error.class}" unless Protest::AssertionFailed === error.error
76
78
  if error.error_message =~ /\n/
77
- puts indent("with #{error.error.class}: <<", 6 + pad_indexes), colorize_as
79
+ puts indent("#{prefix}: <<", 6 + pad_indexes), colorize_as
78
80
  puts indent(error.error_message, 6 + pad_indexes + 2), colorize_as
79
81
  puts indent(">>", 6 + pad_indexes), colorize_as
80
82
  else
81
- puts indent("with #{error.error.class} `#{error.error_message}'", 6 + pad_indexes), colorize_as
83
+ puts indent("#{prefix} `#{error.error_message}'", 6 + pad_indexes), colorize_as
82
84
  end
83
- indent(error.backtrace[0..2], 6 + pad_indexes).each {|backtrace| puts backtrace, colorize_as }
85
+ indent(error.backtrace, 6 + pad_indexes).each {|backtrace| puts backtrace, colorize_as }
84
86
  puts
85
87
  end
86
88
  end
data/lib/protest.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Protest
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
3
3
 
4
4
  # Exception raised when an assertion fails. See TestCase#assert
5
5
  class AssertionFailed < StandardError; end
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "mcmire-protest"
3
- s.version = "0.2.4"
4
- s.date = "2009-11-14"
3
+ s.version = "0.2.5"
4
+ s.date = "2010-01-10"
5
5
 
6
6
  s.description = "Protest is a tiny, simple, and easy-to-extend test framework"
7
7
  s.summary = s.description
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  LICENSE
21
21
  README.rdoc
22
22
  Rakefile
23
- protest.gemspec
23
+ mcmire-protest.gemspec
24
24
  lib/protest.rb
25
25
  lib/protest/utils.rb
26
26
  lib/protest/utils/backtrace_filter.rb
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.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Nicol\xC3\xA1s Sanguinetti"
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-14 00:00:00 -06:00
12
+ date: 2010-01-10 00:00:00 -06:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -26,7 +26,7 @@ files:
26
26
  - LICENSE
27
27
  - README.rdoc
28
28
  - Rakefile
29
- - protest.gemspec
29
+ - mcmire-protest.gemspec
30
30
  - lib/protest.rb
31
31
  - lib/protest/utils.rb
32
32
  - lib/protest/utils/backtrace_filter.rb