parallel_tests 0.8.0 → 0.8.1

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.8.0)
4
+ parallel_tests (0.8.1)
5
5
  parallel
6
6
 
7
7
  GEM
data/Readme.md CHANGED
@@ -152,7 +152,6 @@ You can run any kind of code in parallel with -e / --execute
152
152
 
153
153
  TIPS
154
154
  ====
155
- - [Capybara + Selenium] add to env.rb: `Capybara.server_port = 8888 + ENV['TEST_ENV_NUMBER'].to_i`
156
155
  - [RSpec] add a `.rspec_parallel` to use different options, e.g. **no --drb**
157
156
  - [RSpec] delete `script/spec`
158
157
  - [[Spork](https://github.com/sporkrb/spork)] does not work with parallel_tests
@@ -210,6 +209,7 @@ inspired by [pivotal labs](http://pivotallabs.com/users/miked/blog/articles/849-
210
209
  - [Łukasz Tackowiak](https://github.com/lukasztackowiak)
211
210
  - [Pedro Carriço](https://github.com/pedrocarrico)
212
211
  - [Pablo Manrubia Díez](https://github.com/pmanrubia)
212
+ - [Slawomir Smiechura](https://github.com/ssmiech)
213
213
 
214
214
  [Michael Grosser](http://grosser.it)<br/>
215
215
  michael@grosser.it<br/>
@@ -10,8 +10,7 @@ module ParallelTests
10
10
  color,
11
11
  executable,
12
12
  (runtime_logging if File.directory?(File.dirname(runtime_log))),
13
- options[:test_options],
14
- cucumber_opts,
13
+ cucumber_opts(options[:test_options]),
15
14
  *test_files
16
15
  ].compact.join(" ")
17
16
  execute_command(cmd, process_number, options)
@@ -43,7 +42,15 @@ module ParallelTests
43
42
  line =~ /^\d+ (steps|scenarios)/
44
43
  end
45
44
 
46
- def self.cucumber_opts
45
+ def self.cucumber_opts(given)
46
+ if given =~ /--profile/ or given =~ /(^|\s)-p /
47
+ given
48
+ else
49
+ [given, profile_from_config].compact.join(" ")
50
+ end
51
+ end
52
+
53
+ def self.profile_from_config
47
54
  config = 'config/cucumber.yml'
48
55
  if File.exists?(config) && File.read(config) =~ /^parallel:/
49
56
  "--profile parallel"
@@ -1,3 +1,3 @@
1
1
  module ParallelTests
2
- VERSION = Version = '0.8.0'
2
+ VERSION = Version = '0.8.1'
3
3
  end
@@ -53,12 +53,27 @@ describe ParallelTests::Cucumber do
53
53
  call(['xxx'],1,:test_options => '-p default')
54
54
  end
55
55
 
56
- it "uses parallel profile if config/cucumber.yml contains it" do
57
- file_contents = 'parallel: -f progress'
58
- ParallelTests::Cucumber::Runner.should_receive(:open).with{|x,y| x =~ %r{script/cucumber .* foo bar --profile parallel}}.and_return mocked_process
59
- File.should_receive(:exists?).with('config/cucumber.yml').and_return true
60
- File.should_receive(:read).with('config/cucumber.yml').and_return file_contents
61
- call(['xxx'],1, :test_options => 'foo bar')
56
+ context "with parallel profile in config/cucumber.yml" do
57
+ before do
58
+ file_contents = 'parallel: -f progress'
59
+ File.stub(:exists?).with('config/cucumber.yml').and_return true
60
+ File.stub(:read).with('config/cucumber.yml').and_return file_contents
61
+ end
62
+
63
+ it "uses parallel profile" do
64
+ ParallelTests::Cucumber::Runner.should_receive(:open).with{|x,y| x =~ %r{script/cucumber .* foo bar --profile parallel xxx}}.and_return mocked_process
65
+ call(['xxx'],1, :test_options => 'foo bar')
66
+ end
67
+
68
+ it "uses given profile via --profile" do
69
+ ParallelTests::Cucumber::Runner.should_receive(:open).with{|x,y| x =~ %r{script/cucumber .* --profile foo xxx$}}.and_return mocked_process
70
+ call(['xxx'],1, :test_options => '--profile foo')
71
+ end
72
+
73
+ it "uses given profile via -p" do
74
+ ParallelTests::Cucumber::Runner.should_receive(:open).with{|x,y| x =~ %r{script/cucumber .* -p foo xxx$}}.and_return mocked_process
75
+ call(['xxx'],1, :test_options => '-p foo')
76
+ end
62
77
  end
63
78
 
64
79
  it "does not use parallel profile if config/cucumber.yml does not contain it" do
@@ -1,6 +1,6 @@
1
1
  $LOAD_PATH << File.expand_path("../lib", File.dirname(__FILE__))
2
2
 
3
- FAKE_RAILS_ROOT = '/tmp/pspecs/fixtures'
3
+ FAKE_RAILS_ROOT = './tmp/pspecs/fixtures'
4
4
 
5
5
  require 'tempfile'
6
6
  require 'parallel_tests'
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.0
4
+ version: 0.8.1
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-04-29 00:00:00.000000000 Z
12
+ date: 2012-05-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: parallel
@@ -89,7 +89,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
89
89
  version: '0'
90
90
  segments:
91
91
  - 0
92
- hash: 1985471141696551729
92
+ hash: 2085209291365411604
93
93
  required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  version: '0'
99
99
  segments:
100
100
  - 0
101
- hash: 1985471141696551729
101
+ hash: 2085209291365411604
102
102
  requirements: []
103
103
  rubyforge_project:
104
104
  rubygems_version: 1.8.24