sauce 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/sauce/capybara.rb +18 -2
- data/lib/sauce/config.rb +11 -5
- data/lib/sauce/rspec.rb +1 -1
- data/lib/sauce/version.rb +1 -1
- data/lib/tasks/parallel_testing.rb +51 -55
- data/spec/sauce/config/perfile_browser_spec.rb +105 -0
- data/spec/sauce/jasmine_spec.rb +7 -26
- data/spec/sauce/tasks_spec.rb +180 -0
- metadata +8 -4
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NWYwMzk0OTAwOWExN2U1ZTVlYjY1ODA3ZmU5ZTZiNTQ5N2Q2ZDdkZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NmNiOTFiNmRlNDhlOTg5ZmVjM2ZkN2Q1YzZkZWIyZWQwZjFjZjkyZg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YzY5ODc2OTg0ZGZmYTYzZDI4Y2EwMDlmYTQzMjUxMmM2MTY2ODQ5MDU0MTk4
|
10
|
+
ZjliNDZlNGQ1YWFjZTIzZGU3YTU4NTNlN2E1Y2ZjMDBiYWE5MWU5MGYzMjQ3
|
11
|
+
YjNhZGE2Yzk5NDExYjkzMmNlY2I1ZWM0NWRhM2Q2ZjU4NWJmMTg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODVkZjc0NzQ2ZDk0NzViNWZhODQ5ZmYwM2E3MjMxMjQ1MGI2YmVlNmJlMDlh
|
14
|
+
OGIzZjM3MWVlNjAxZWM2YWQ4OTdjOGFjMjhlMzJkZWQzODA0MWJjOTdkOTg1
|
15
|
+
OWE0NjU2MzgwOTYyMjFmYTMwMmE0NGNlODllZWNjMDYzZGU5YTQ=
|
data/lib/sauce/capybara.rb
CHANGED
@@ -38,14 +38,13 @@ module Sauce
|
|
38
38
|
|
39
39
|
alias :base_visit :visit
|
40
40
|
alias :base_current_url :current_url
|
41
|
-
alias :base_reset! :reset!
|
42
41
|
alias :base_within_frame :within_frame
|
43
42
|
alias :base_within_window :within_window
|
44
43
|
alias :base_find_window :find_window
|
45
44
|
alias :base_execute_script :execute_script
|
46
45
|
alias :base_evaluate_script :evaluate_script
|
47
46
|
|
48
|
-
@methods_to_retry = [:visit, :current_url,
|
47
|
+
@methods_to_retry = [:visit, :current_url,
|
49
48
|
:within_frame, :within_window, :find_window, :source,
|
50
49
|
:execute_script, :evaluate_script
|
51
50
|
]
|
@@ -114,6 +113,23 @@ module Sauce
|
|
114
113
|
def render(path)
|
115
114
|
browser.save_screenshot path
|
116
115
|
end
|
116
|
+
|
117
|
+
# Overridden to deal with Capybara calling empty html file.
|
118
|
+
# Stolen from (And can be removed when superceeded by the merge of)
|
119
|
+
# https://github.com/jnicklas/capybara/pull/1215
|
120
|
+
def reset!
|
121
|
+
empty_html = "data:text/html,<html></html>"
|
122
|
+
# Use instance variable directly so we avoid starting the browser just to reset the session
|
123
|
+
if @browser
|
124
|
+
begin @browser.manage.delete_all_cookies
|
125
|
+
rescue Selenium::WebDriver::Error::UnhandledError
|
126
|
+
# delete_all_cookies fails when we've previously gone
|
127
|
+
# to about:blank, so we rescue this error and do nothing
|
128
|
+
# instead.
|
129
|
+
end
|
130
|
+
@browser.navigate.to(empty_html)
|
131
|
+
end
|
132
|
+
end
|
117
133
|
end
|
118
134
|
end
|
119
135
|
end
|
data/lib/sauce/config.rb
CHANGED
@@ -181,13 +181,19 @@ module Sauce
|
|
181
181
|
return [[os, browser, browser_version]]
|
182
182
|
end
|
183
183
|
|
184
|
-
def
|
184
|
+
def browsers_for_location(file, linenumber=nil)
|
185
185
|
Sauce::Config.called_from_integrations
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
186
|
+
perfile_browsers = @opts[:perfile_browsers]
|
187
|
+
|
188
|
+
if perfile_browsers
|
189
|
+
platforms = []
|
190
|
+
test_location = "#{file}:#{linenumber}"
|
191
|
+
if linenumber && (perfile_browsers.include? test_location)
|
192
|
+
platforms = perfile_browsers[test_location]
|
193
|
+
else
|
194
|
+
platforms = perfile_browsers[file]
|
190
195
|
end
|
196
|
+
platforms.map { |p| [p['os'], p['browser'], p['version']] }
|
191
197
|
else
|
192
198
|
browsers
|
193
199
|
end
|
data/lib/sauce/rspec.rb
CHANGED
@@ -78,7 +78,7 @@ begin
|
|
78
78
|
config = Sauce::Config.new
|
79
79
|
description = the_test.metadata[:full_description]
|
80
80
|
file = the_test.metadata[:file_path]
|
81
|
-
config.
|
81
|
+
config.browsers_for_location(file).each do |os, browser, version|
|
82
82
|
@selenium = Sauce::Selenium2.new({:os => os,
|
83
83
|
:browser => browser,
|
84
84
|
:browser_version => version,
|
data/lib/sauce/version.rb
CHANGED
@@ -3,66 +3,16 @@ require "parallel_tests"
|
|
3
3
|
require "parallel_tests/tasks"
|
4
4
|
require "parallel_tests/cli_patch"
|
5
5
|
|
6
|
+
|
6
7
|
namespace :sauce do
|
7
|
-
task :spec, :spec_files, :concurrency, :
|
8
|
+
task :spec, :spec_files, :concurrency, :test_options, :parallel_options do |t, args|
|
8
9
|
::RSpec::Core::Runner.disable_autorun!
|
9
|
-
|
10
|
-
env_args = {
|
11
|
-
:concurrency => ENV['concurrency'],
|
12
|
-
:rspec_options => ENV['rspec_options'],
|
13
|
-
:spec_files => ENV['specs']
|
14
|
-
}
|
15
|
-
|
16
|
-
env_args.delete_if {|k,v| k.nil? || k == ''}
|
17
|
-
|
18
|
-
args.with_defaults({
|
19
|
-
:concurrency => [Sauce::TestBroker.concurrency, 20].min,
|
20
|
-
:files => "spec",
|
21
|
-
:rspec_opts => "-t sauce"
|
22
|
-
})
|
23
|
-
|
24
|
-
concurrency = env_args[:concurrency] || args[:concurrency]
|
25
|
-
spec_files = env_args[:spec_files] || args[:files]
|
26
|
-
rspec_options = env_args[:rspec_options] || args[:rspec_options]
|
27
|
-
|
28
|
-
parallel_arguments = [
|
29
|
-
"--type", "saucerspec",
|
30
|
-
"-n", "#{concurrency}"
|
31
|
-
]
|
32
|
-
|
33
|
-
unless rspec_options.nil?
|
34
|
-
parallel_arguments.push "-o"
|
35
|
-
parallel_arguments.push rspec_options
|
36
|
-
end
|
37
|
-
|
38
|
-
parallel_arguments.push spec_files
|
39
|
-
|
10
|
+
parallel_arguments = parse_task_args(:rspec, args)
|
40
11
|
ParallelTests::CLI.new.run(parallel_arguments)
|
41
12
|
end
|
42
13
|
|
43
|
-
task :features, :files, :concurrency
|
44
|
-
args
|
45
|
-
:concurrency => [Sauce::TestBroker.concurrency, 20].min,
|
46
|
-
:files => "features"
|
47
|
-
})
|
48
|
-
|
49
|
-
env_args = {
|
50
|
-
:concurrency => ENV['concurrency'],
|
51
|
-
:features => ENV['features']
|
52
|
-
}
|
53
|
-
|
54
|
-
env_args.delete_if {|k,v| k.nil? || k == ''}
|
55
|
-
|
56
|
-
concurrency = env_args[:concurrency] || args[:concurrency]
|
57
|
-
features = env_args[:features] || args[:files]
|
58
|
-
|
59
|
-
parallel_arguments = [
|
60
|
-
"--type", "saucecucumber",
|
61
|
-
"-n", concurrency.to_s,
|
62
|
-
features
|
63
|
-
]
|
64
|
-
|
65
|
-
STDERR.puts "ARGS #{parallel_arguments}"
|
14
|
+
task :features, :files, :concurrency, :test_options, :parallel_options do |t, args|
|
15
|
+
parallel_arguments = parse_task_args(:cucumber, args)
|
66
16
|
ParallelTests::CLI.new.run(parallel_arguments)
|
67
17
|
end
|
68
18
|
|
@@ -115,3 +65,49 @@ namespace :sauce do
|
|
115
65
|
end
|
116
66
|
end
|
117
67
|
end
|
68
|
+
|
69
|
+
def parse_task_args(test_tool=:rspec, args)
|
70
|
+
default = {
|
71
|
+
:concurrency => [Sauce::TestBroker.concurrency, 20].min
|
72
|
+
}
|
73
|
+
|
74
|
+
if test_tool == :rspec
|
75
|
+
default[:test_options] = '-t sauce'
|
76
|
+
default[:files] = 'spec'
|
77
|
+
end
|
78
|
+
|
79
|
+
if test_tool == :cucumber
|
80
|
+
default[:files] = 'features'
|
81
|
+
end
|
82
|
+
|
83
|
+
env_args = {
|
84
|
+
:concurrency => ENV['concurrency'],
|
85
|
+
:features => ENV['features'],
|
86
|
+
:parallel_options => ENV['parallel_test_options'],
|
87
|
+
:test_options => ENV['test_options'],
|
88
|
+
:files => ENV['test_files']
|
89
|
+
}
|
90
|
+
|
91
|
+
concurrency = args[:concurrency] || env_args[:concurrency] || default[:concurrency]
|
92
|
+
test_options = args[:test_options] || env_args[:test_options] || default[:test_options]
|
93
|
+
parallel_options = args[:parallel_options] || env_args[:parallel_options]
|
94
|
+
files = args[:files] || env_args[:files] || default[:files]
|
95
|
+
|
96
|
+
return_args = [
|
97
|
+
'-n', concurrency.to_s,
|
98
|
+
'--type'
|
99
|
+
]
|
100
|
+
|
101
|
+
return_args.push 'saucerspec' if test_tool == :rspec
|
102
|
+
return_args.push 'saucecucumber' if test_tool == :cucumber
|
103
|
+
|
104
|
+
if test_options
|
105
|
+
return_args.push '-o'
|
106
|
+
return_args.push test_options
|
107
|
+
end
|
108
|
+
|
109
|
+
return_args.push *(parallel_options.split(' ')) if parallel_options
|
110
|
+
return_args.push files
|
111
|
+
|
112
|
+
return return_args
|
113
|
+
end
|
@@ -0,0 +1,105 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "Sauce::Config" do
|
4
|
+
describe "#perfile_browsers" do
|
5
|
+
before :each do
|
6
|
+
ENV['SAUCE_PERFILE_BROWSERS'] = nil
|
7
|
+
end
|
8
|
+
|
9
|
+
after :each do
|
10
|
+
ENV['SAUCE_PERFILE_BROWSERS'] = nil
|
11
|
+
end
|
12
|
+
|
13
|
+
it "returns browsers when perfile_browsers is blank" do
|
14
|
+
expected_browsers = [
|
15
|
+
["Linux", "Chrome", "nil"]
|
16
|
+
]
|
17
|
+
|
18
|
+
Sauce.config do |c|
|
19
|
+
c[:browsers] = expected_browsers
|
20
|
+
end
|
21
|
+
|
22
|
+
config = Sauce::Config.new
|
23
|
+
|
24
|
+
filename = "./features/duckduck.feature"
|
25
|
+
fn = 14
|
26
|
+
|
27
|
+
Sauce::Config.new.browsers_for_location(filename, fn).should eq expected_browsers
|
28
|
+
end
|
29
|
+
|
30
|
+
it "should return the browsers for the requested location" do
|
31
|
+
expected_browsers = [
|
32
|
+
["Linux", "Chrome", "nil"],
|
33
|
+
["Mac", "Safari", "5"]
|
34
|
+
]
|
35
|
+
|
36
|
+
browser_hash = expected_browsers.map { |a|
|
37
|
+
{"os" => a[0], "browser" => a[1], "version" => a[2]}
|
38
|
+
}
|
39
|
+
|
40
|
+
env_hash = {
|
41
|
+
"./features/duckduck.feature:14"=> browser_hash,
|
42
|
+
"./features/adifferent.feature"=>[
|
43
|
+
{"os"=>"Windows 7", "browser"=>"Firefox", "version"=>"19"}
|
44
|
+
]
|
45
|
+
}
|
46
|
+
|
47
|
+
ENV['SAUCE_PERFILE_BROWSERS'] = env_hash.to_json
|
48
|
+
|
49
|
+
filename = "./features/duckduck.feature"
|
50
|
+
fn = 14
|
51
|
+
|
52
|
+
Sauce::Config.new.browsers_for_location(filename, fn).should eq expected_browsers
|
53
|
+
end
|
54
|
+
|
55
|
+
it "returns the line number location if present" do
|
56
|
+
expected_browsers = [
|
57
|
+
["Linux", "Chrome", "nil"],
|
58
|
+
["Mac", "Safari", "5"]
|
59
|
+
]
|
60
|
+
|
61
|
+
browser_hash = expected_browsers.map { |a|
|
62
|
+
{"os" => a[0], "browser" => a[1], "version" => a[2]}
|
63
|
+
}
|
64
|
+
|
65
|
+
env_hash = {
|
66
|
+
"./features/duckduck.feature"=>[
|
67
|
+
{"os"=>"Windows 7", "browser"=>"Firefox", "version"=>"19"}
|
68
|
+
],
|
69
|
+
"./features/duckduck.feature:11"=> browser_hash
|
70
|
+
}
|
71
|
+
|
72
|
+
ENV['SAUCE_PERFILE_BROWSERS'] = env_hash.to_json
|
73
|
+
|
74
|
+
filename = "./features/duckduck.feature"
|
75
|
+
fn = 11
|
76
|
+
|
77
|
+
Sauce::Config.new.browsers_for_location(filename, fn).should eq expected_browsers
|
78
|
+
end
|
79
|
+
|
80
|
+
it "ignores line number if it can't find it" do
|
81
|
+
expected_browsers = [
|
82
|
+
["Linux", "Chrome", "nil"],
|
83
|
+
["Mac", "Safari", "5"]
|
84
|
+
]
|
85
|
+
|
86
|
+
browser_hash = expected_browsers.map { |a|
|
87
|
+
{"os" => a[0], "browser" => a[1], "version" => a[2]}
|
88
|
+
}
|
89
|
+
|
90
|
+
env_hash = {
|
91
|
+
"./features/duckduck.feature:11"=>[
|
92
|
+
{"os"=>"Windows 7", "browser"=>"Firefox", "version"=>"19"}
|
93
|
+
],
|
94
|
+
"./features/duckduck.feature"=> browser_hash
|
95
|
+
}
|
96
|
+
|
97
|
+
ENV['SAUCE_PERFILE_BROWSERS'] = env_hash.to_json
|
98
|
+
|
99
|
+
filename = "./features/duckduck.feature"
|
100
|
+
fn = 6
|
101
|
+
|
102
|
+
Sauce::Config.new.browsers_for_location(filename, fn).should eq expected_browsers
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
data/spec/sauce/jasmine_spec.rb
CHANGED
@@ -1,49 +1,30 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
require 'sauce/jasmine'
|
3
3
|
|
4
|
-
describe
|
4
|
+
describe Jasmine::SeleniumDriver do
|
5
5
|
describe '#initialize' do
|
6
6
|
let(:address) { 'http://saucelabs.com' }
|
7
7
|
let(:browser) { 'firefox' }
|
8
8
|
|
9
9
|
it 'should take set the @http_address' do
|
10
10
|
Sauce::Selenium2.stub(:new)
|
11
|
-
d =
|
11
|
+
d = Jasmine::SeleniumDriver.new(browser, address)
|
12
12
|
d.http_address.should equal(address)
|
13
13
|
end
|
14
14
|
|
15
15
|
it 'should initialize a Sauce driver' do
|
16
16
|
Sauce::Selenium2.should_receive(:new).with(anything).and_return(true)
|
17
|
-
d =
|
17
|
+
d = Jasmine::SeleniumDriver.new(browser, address)
|
18
18
|
d.should_not be_nil
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
23
|
|
24
|
-
describe Jasmine::
|
25
|
-
describe '#
|
26
|
-
|
27
|
-
|
28
|
-
Sauce::Selenium2.stub(:new)
|
29
|
-
Sauce::Jasmine::Driver.stub(:new).and_return(driver)
|
30
|
-
end
|
31
|
-
|
32
|
-
let(:driver) do
|
33
|
-
driver = double('Sauce::Jasmine::Driver')
|
34
|
-
driver.stub(:connect)
|
35
|
-
driver
|
36
|
-
end
|
37
|
-
|
38
|
-
it 'should create a Sauce::Jasmine::Driver' do
|
39
|
-
Sauce::Jasmine::Driver.should_receive(:new).and_return(driver)
|
40
|
-
subject.start
|
41
|
-
subject.instance_variable_get(:@client).should be driver
|
42
|
-
end
|
43
|
-
|
44
|
-
it 'should call connect on the driver' do
|
45
|
-
driver.should_receive(:connect)
|
46
|
-
subject.start
|
24
|
+
describe Jasmine::Configuration do
|
25
|
+
describe '#port' do
|
26
|
+
it 'returns 3001' do
|
27
|
+
expect(Jasmine::Configuration.new.port).to eq(3001)
|
47
28
|
end
|
48
29
|
end
|
49
30
|
end
|
@@ -0,0 +1,180 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'parse_task_args' do
|
4
|
+
before :each do
|
5
|
+
Sauce::TestBroker.stub(:concurrency) {20}
|
6
|
+
end
|
7
|
+
|
8
|
+
it 'returns the saucerspec type when using rspec' do
|
9
|
+
actual_args = parse_task_args(:rspec, {}).join ' '
|
10
|
+
actual_args.should include '--type saucerspec'
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'returns the saucecucumber type when using cucumber' do
|
14
|
+
actual_args = parse_task_args(:cucumber, {}).join ' '
|
15
|
+
actual_args.should include '--type saucecucumber'
|
16
|
+
end
|
17
|
+
|
18
|
+
context 'files' do
|
19
|
+
it 'is parsed from the :files argument' do
|
20
|
+
task_args = {:files => 'proscuitto/iberico.spec'}
|
21
|
+
actual_args = parse_task_args(task_args).join ' '
|
22
|
+
actual_args.end_with?('proscuitto/iberico.spec').should be_true
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'defaults to spec when rspec is used' do
|
26
|
+
actual_args = parse_task_args(:rspec, {}).join ' '
|
27
|
+
actual_args.end_with?('spec').should be_true
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'defaults to features when cucumber is used' do
|
31
|
+
actual_args = parse_task_args(:cucumber, {}).join ' '
|
32
|
+
actual_args.end_with?('features').should be_true
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'when set by environment variable' do
|
36
|
+
before :each do
|
37
|
+
@stored_test_files = ENV['test_files']
|
38
|
+
ENV['test_files'] = nil
|
39
|
+
end
|
40
|
+
|
41
|
+
after :each do
|
42
|
+
ENV['test_files'] = @stored_test_files
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'comes from the test_files variable' do
|
46
|
+
ENV['test_files'] = 'pancetta'
|
47
|
+
actual_args = parse_task_args(:rspec, {}).join ' '
|
48
|
+
actual_args.end_with?('pancetta').should be_true
|
49
|
+
end
|
50
|
+
|
51
|
+
it 'is overridden by the CLI' do
|
52
|
+
ENV['test_files'] = 'spam'
|
53
|
+
test_args = {:files => 'bacon'}
|
54
|
+
actual_args = parse_task_args(:rspec, test_args).join ' '
|
55
|
+
actual_args.end_with?('bacon').should be_true
|
56
|
+
actual_args.should_not include 'spam'
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
context 'concurrency' do
|
62
|
+
it 'parses the second argument' do
|
63
|
+
task_args = {:features => 'features', :concurrency => '4'}
|
64
|
+
actual_args = parse_task_args(task_args).join ' '
|
65
|
+
actual_args.should include '-n 4'
|
66
|
+
end
|
67
|
+
|
68
|
+
context 'when set by environment variable' do
|
69
|
+
before :each do
|
70
|
+
@stored_concurrency = ENV['concurrency']
|
71
|
+
ENV['concurrency'] = nil
|
72
|
+
end
|
73
|
+
|
74
|
+
after :each do
|
75
|
+
ENV['concurrency'] = @stored_concurrency
|
76
|
+
end
|
77
|
+
|
78
|
+
it 'is parsed out' do
|
79
|
+
ENV['concurrency'] = '18'
|
80
|
+
actual_args = parse_task_args({}).join ' '
|
81
|
+
actual_args.should include '-n 18'
|
82
|
+
end
|
83
|
+
|
84
|
+
it 'is overridden by the CLI' do
|
85
|
+
ENV['concurrency'] = '14'
|
86
|
+
task_args = {:files => 'features', :concurrency => '12'}
|
87
|
+
actual_args = parse_task_args(task_args).join ' '
|
88
|
+
actual_args.should include '-n 12'
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
context 'test options' do
|
93
|
+
it 'are parsed from the test_options argument' do
|
94
|
+
task_args = {:test_options => '--no-derp'}
|
95
|
+
actual_args = parse_task_args(task_args).join ' '
|
96
|
+
actual_args.should include '-o --no-derp'
|
97
|
+
end
|
98
|
+
|
99
|
+
context 'when not supplied' do
|
100
|
+
it 'default to -t sauce for rspec' do
|
101
|
+
actual_args = parse_task_args(:rspec, {}).join ' '
|
102
|
+
actual_args.should include '-o -t sauce'
|
103
|
+
end
|
104
|
+
|
105
|
+
it 'defaults to not being present for cucumber' do
|
106
|
+
actual_args = parse_task_args(:cucmber, {}).join ' '
|
107
|
+
actual_args.should_not include '-o'
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
context 'when set from environment options' do
|
112
|
+
before :each do
|
113
|
+
@stored_rspec_options = ENV['test_options']
|
114
|
+
ENV['test_options'] = nil
|
115
|
+
end
|
116
|
+
|
117
|
+
after :each do
|
118
|
+
ENV['test_options'] = @stored_rspec_options
|
119
|
+
end
|
120
|
+
|
121
|
+
it 'is read from the test_options variable' do
|
122
|
+
ENV['test_options'] = '-derp_level some'
|
123
|
+
actual_args = parse_task_args({}).join ' '
|
124
|
+
actual_args.should include '-o -derp_level some'
|
125
|
+
end
|
126
|
+
|
127
|
+
it 'is overridden by the CLI' do
|
128
|
+
ENV['test_options'] = '-derp_level maximum'
|
129
|
+
task_args = {:test_options => '--no-derp'}
|
130
|
+
actual_args = parse_task_args(task_args).join ' '
|
131
|
+
actual_args.should_not include '-derp_level maximum'
|
132
|
+
actual_args.should include '-o --no-derp'
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
context "parallel tests options" do
|
138
|
+
it 'is parsed from the parallel_options argument' do
|
139
|
+
test_args = {:parallel_options => 'wow'}
|
140
|
+
actual_args = parse_task_args(test_args).join ' '
|
141
|
+
actual_args.should include 'wow'
|
142
|
+
end
|
143
|
+
|
144
|
+
it 'is broken into individual options' do
|
145
|
+
test_args = {:parallel_options => '--scared so'}
|
146
|
+
actual_args = parse_task_args(:rspec, test_args)
|
147
|
+
|
148
|
+
actual_args.should include '--scared'
|
149
|
+
actual_args.should include 'so'
|
150
|
+
index = actual_args.index '--scared'
|
151
|
+
actual_args[index + 1].should eq 'so'
|
152
|
+
end
|
153
|
+
|
154
|
+
context 'read from environment variables' do
|
155
|
+
before :each do
|
156
|
+
@@stored_rspec_options = ENV['rspec_options']
|
157
|
+
ENV['parallel_test_options'] = nil
|
158
|
+
end
|
159
|
+
|
160
|
+
after :each do
|
161
|
+
ENV['parallel_test_options'] = @@stored_rspec_options
|
162
|
+
end
|
163
|
+
|
164
|
+
it 'is read from the parallel_test_options variable' do
|
165
|
+
ENV['parallel_test_options'] = '-such option'
|
166
|
+
actual_args = parse_task_args({}).join ' '
|
167
|
+
actual_args.should include '-such option'
|
168
|
+
end
|
169
|
+
|
170
|
+
it 'is overridden by the CLI' do
|
171
|
+
ENV['parallel_test_options'] = '-such option'
|
172
|
+
task_args = {:parallel_options => 'many override'}
|
173
|
+
actual_args = parse_task_args(task_args).join ' '
|
174
|
+
actual_args.should_not include '-such option'
|
175
|
+
actual_args.should include 'many override'
|
176
|
+
end
|
177
|
+
end
|
178
|
+
end
|
179
|
+
end
|
180
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sauce
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dylan Lacey
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date:
|
16
|
+
date: 2014-01-02 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: capybara
|
@@ -189,14 +189,14 @@ dependencies:
|
|
189
189
|
requirements:
|
190
190
|
- - '='
|
191
191
|
- !ruby/object:Gem::Version
|
192
|
-
version: 0.
|
192
|
+
version: 0.16.5
|
193
193
|
type: :runtime
|
194
194
|
prerelease: false
|
195
195
|
version_requirements: !ruby/object:Gem::Requirement
|
196
196
|
requirements:
|
197
197
|
- - '='
|
198
198
|
- !ruby/object:Gem::Version
|
199
|
-
version: 0.
|
199
|
+
version: 0.16.5
|
200
200
|
- !ruby/object:Gem::Dependency
|
201
201
|
name: sauce_whisk
|
202
202
|
requirement: !ruby/object:Gem::Requirement
|
@@ -262,12 +262,14 @@ files:
|
|
262
262
|
- spec/sauce/config/default_browsers_spec.rb
|
263
263
|
- spec/sauce/config/environment_config_spec.rb
|
264
264
|
- spec/sauce/config/load_defaults_spec.rb
|
265
|
+
- spec/sauce/config/perfile_browser_spec.rb
|
265
266
|
- spec/sauce/cucumber_spec.rb
|
266
267
|
- spec/sauce/driver_pool_spec.rb
|
267
268
|
- spec/sauce/file_detector_spec.rb
|
268
269
|
- spec/sauce/jasmine_spec.rb
|
269
270
|
- spec/sauce/parallel/test_broker_spec.rb
|
270
271
|
- spec/sauce/selenium_spec.rb
|
272
|
+
- spec/sauce/tasks_spec.rb
|
271
273
|
- spec/sauce/utilities/rails_server_spec.rb
|
272
274
|
- spec/sauce/utilities/rake_spec.rb
|
273
275
|
- spec/sauce/utilities/utilities_spec.rb
|
@@ -316,12 +318,14 @@ test_files:
|
|
316
318
|
- spec/sauce/config/default_browsers_spec.rb
|
317
319
|
- spec/sauce/config/environment_config_spec.rb
|
318
320
|
- spec/sauce/config/load_defaults_spec.rb
|
321
|
+
- spec/sauce/config/perfile_browser_spec.rb
|
319
322
|
- spec/sauce/cucumber_spec.rb
|
320
323
|
- spec/sauce/driver_pool_spec.rb
|
321
324
|
- spec/sauce/file_detector_spec.rb
|
322
325
|
- spec/sauce/jasmine_spec.rb
|
323
326
|
- spec/sauce/parallel/test_broker_spec.rb
|
324
327
|
- spec/sauce/selenium_spec.rb
|
328
|
+
- spec/sauce/tasks_spec.rb
|
325
329
|
- spec/sauce/utilities/rails_server_spec.rb
|
326
330
|
- spec/sauce/utilities/rake_spec.rb
|
327
331
|
- spec/sauce/utilities/utilities_spec.rb
|