parallel_tests 0.8.6 → 0.8.7

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- parallel_tests (0.8.6)
4
+ parallel_tests (0.8.7)
5
5
  parallel
6
6
 
7
7
  GEM
data/Readme.md CHANGED
@@ -215,6 +215,7 @@ inspired by [pivotal labs](http://pivotallabs.com/users/miked/blog/articles/849-
215
215
  - [Georg Friedrich](https://github.com/georg)
216
216
  - [R. Tyler Croy](https://github.com/rtyler)
217
217
  - [Ulrich Berkmüller](https://github.com/ulrich-berkmueller)
218
+ - [https://github.com/madmax](https://github.com/madmax)
218
219
 
219
220
  [Michael Grosser](http://grosser.it)<br/>
220
221
  michael@grosser.it<br/>
@@ -34,7 +34,7 @@ module ParallelTest
34
34
  report_results runner, test_results
35
35
  end
36
36
 
37
- abort "#{lib.capitalize}s Failed" if any_test_failed?(test_results)
37
+ abort final_fail_message(lib) if any_test_failed?(test_results)
38
38
  end
39
39
 
40
40
  def self.run_tests(runner, group, process_number, options)
@@ -134,5 +134,15 @@ TEXT
134
134
  puts ""
135
135
  puts "Took #{Time.now - start} seconds"
136
136
  end
137
+
138
+ def self.final_fail_message(lib)
139
+ fail_message = "#{lib.capitalize}s Failed"
140
+ fail_message = "\e[31m#{fail_message}\e[0m" if use_colors?
141
+ fail_message
142
+ end
143
+
144
+ def self.use_colors?
145
+ $stdout.tty?
146
+ end
137
147
  end
138
148
  end
@@ -1,3 +1,3 @@
1
1
  module ParallelTests
2
- VERSION = Version = '0.8.6'
2
+ VERSION = Version = '0.8.7'
3
3
  end
@@ -21,4 +21,16 @@ describe ParallelTest::CLI do
21
21
  call(["--non-parallel"]).should == defaults.merge(:non_parallel => true)
22
22
  end
23
23
  end
24
+
25
+ describe ".final_fail_message" do
26
+ it 'returns a plain fail message if colors are nor supported' do
27
+ ParallelTest::CLI.should_receive(:use_colors?).and_return false
28
+ ParallelTest::CLI.send(:final_fail_message, "Test").should == "Tests Failed"
29
+ end
30
+
31
+ it 'returns a colorized fail message if colors are supported' do
32
+ ParallelTest::CLI.should_receive(:use_colors?).and_return true
33
+ ParallelTest::CLI.send(:final_fail_message, "Test").should == "\e[31mTests Failed\e[0m"
34
+ end
35
+ end
24
36
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parallel_tests
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.6
4
+ version: 0.8.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-21 00:00:00.000000000 Z
12
+ date: 2012-07-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: parallel
@@ -90,7 +90,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
90
90
  version: '0'
91
91
  segments:
92
92
  - 0
93
- hash: -3705474874621268177
93
+ hash: -2768258193034992636
94
94
  required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  none: false
96
96
  requirements:
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  version: '0'
100
100
  segments:
101
101
  - 0
102
- hash: -3705474874621268177
102
+ hash: -2768258193034992636
103
103
  requirements: []
104
104
  rubyforge_project:
105
105
  rubygems_version: 1.8.24