parallel_tests 0.10.3 → 0.10.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- parallel_tests (0.10.3)
4
+ parallel_tests (0.10.4)
5
5
  parallel
6
6
 
7
7
  GEM
data/Readme.md CHANGED
@@ -261,6 +261,7 @@ inspired by [pivotal labs](http://pivotallabs.com/users/miked/blog/articles/849-
261
261
  - [David Davis](https://github.com/daviddavis)
262
262
  - [Ari Pollak](https://github.com/aripollak)
263
263
  - [Aaron Jensen](https://github.com/aaronjensen)
264
+ - [Artur Roszczyk](https://github.com/sevos)
264
265
 
265
266
  [Michael Grosser](http://grosser.it)<br/>
266
267
  michael@grosser.it<br/>
@@ -18,7 +18,7 @@ module ParallelTests
18
18
  execute_command(cmd, process_number, num_processes, options)
19
19
  end
20
20
 
21
- def self.executable
21
+ def self.determine_executable
22
22
  if ParallelTests.bundler_enabled?
23
23
  "bundle exec cucumber"
24
24
  elsif File.file?("script/cucumber")
@@ -12,7 +12,7 @@ module ParallelTests
12
12
  execute_command(cmd, process_number, num_processes, options)
13
13
  end
14
14
 
15
- def self.executable
15
+ def self.determine_executable
16
16
  cmd = if File.file?("script/spec")
17
17
  "script/spec"
18
18
  elsif ParallelTests.bundler_enabled?
@@ -23,7 +23,7 @@ module ParallelTests
23
23
 
24
24
  def self.run_tests(test_files, process_number, num_processes, options)
25
25
  require_list = test_files.map { |filename| %{"#{File.expand_path filename}"} }.join(",")
26
- cmd = "ruby -Itest -e '[#{require_list}].each {|f| require f }' -- #{options[:test_options]}"
26
+ cmd = "#{executable} -Itest -e '[#{require_list}].each {|f| require f }' -- #{options[:test_options]}"
27
27
  execute_command(cmd, process_number, num_processes, options)
28
28
  end
29
29
 
@@ -73,6 +73,14 @@ module ParallelTests
73
73
 
74
74
  protected
75
75
 
76
+ def self.executable
77
+ ENV['PARALLEL_TESTS_EXECUTABLE'] || determine_executable
78
+ end
79
+
80
+ def self.determine_executable
81
+ "ruby"
82
+ end
83
+
76
84
  def self.sum_up_results(results)
77
85
  results = results.join(' ').gsub(/s\b/,'') # combine and singularize results
78
86
  counts = results.scan(/(\d+) (\w+)/)
@@ -1,3 +1,3 @@
1
1
  module ParallelTests
2
- VERSION = Version = '0.10.3'
2
+ VERSION = Version = '0.10.4'
3
3
  end
@@ -30,6 +30,13 @@ describe ParallelTests::Cucumber do
30
30
  call(['xxx'],1,22,{})
31
31
  end
32
32
 
33
+ it "allows to override runner executable via PARALLEL_TESTS_EXECUTABLE" do
34
+ ENV['PARALLEL_TESTS_EXECUTABLE'] = 'script/custom_rspec'
35
+ ParallelTests::Cucumber::Runner.should_receive(:open).with{|x,y| x=~/script\/custom_rspec/}.and_return mocked_process
36
+ call(['xxx'],1,22,{})
37
+ ENV.delete('PARALLEL_TESTS_EXECUTABLE')
38
+ end
39
+
33
40
  it "returns the output" do
34
41
  io = open('spec/spec_helper.rb')
35
42
  $stdout.stub!(:print)
@@ -32,6 +32,13 @@ describe ParallelTests::RSpec::Runner do
32
32
  call(['xxx'],1,22,{})
33
33
  end
34
34
 
35
+ it "allows to override runner executable via PARALLEL_TESTS_EXECUTABLE" do
36
+ ENV['PARALLEL_TESTS_EXECUTABLE'] = 'script/custom_rspec'
37
+ ParallelTests::RSpec::Runner.should_receive(:open).with{|x,y| x=~/script\/custom_rspec/}.and_return mocked_process
38
+ call(['xxx'],1,22,{})
39
+ ENV.delete('PARALLEL_TESTS_EXECUTABLE')
40
+ end
41
+
35
42
  it "runs with color when called from cmdline" do
36
43
  ParallelTests::RSpec::Runner.should_receive(:open).with{|x,y| x=~/ --tty /}.and_return mocked_process
37
44
  $stdout.should_receive(:tty?).and_return true
@@ -26,6 +26,13 @@ describe ParallelTests::Test::Runner do
26
26
  ENV.delete('PARALLEL_TEST_PROCESSORS')
27
27
  end
28
28
 
29
+ it "allows to override runner executable via PARALLEL_TESTS_EXECUTABLE" do
30
+ ENV['PARALLEL_TESTS_EXECUTABLE'] = 'script/custom_rspec'
31
+ ParallelTests::Test::Runner.should_receive(:open).with{|x,y| x=~/script\/custom_rspec/}.and_return mocked_process
32
+ call(['xxx'],1,22,{})
33
+ ENV.delete('PARALLEL_TESTS_EXECUTABLE')
34
+ end
35
+
29
36
  it "uses options" do
30
37
  ParallelTests::Test::Runner.should_receive(:open).with{|x,y| x=~ %r{ruby -Itest .* -- -v}}.and_return mocked_process
31
38
  call(['xxx'],1,22,:test_options => '-v')
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.10.3
4
+ version: 0.10.4
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: 2013-03-20 00:00:00.000000000 Z
12
+ date: 2013-03-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: parallel
@@ -93,7 +93,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
93
93
  version: '0'
94
94
  segments:
95
95
  - 0
96
- hash: -3820588893429922123
96
+ hash: -3747523208207304867
97
97
  required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  none: false
99
99
  requirements:
@@ -102,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
102
  version: '0'
103
103
  segments:
104
104
  - 0
105
- hash: -3820588893429922123
105
+ hash: -3747523208207304867
106
106
  requirements: []
107
107
  rubyforge_project:
108
108
  rubygems_version: 1.8.25