sauce_whisk 0.0.20 → 0.0.21
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 +4 -4
- data/changelog.markdown +5 -1
- data/lib/sauce_whisk/jobs.rb +11 -7
- data/lib/sauce_whisk/version.rb +1 -1
- metadata +3 -53
- data/.rspec +0 -1
- data/sauce_whisk.gemspec +0 -28
- data/spec/fixtures/vcr_cassettes/accounts.yml +0 -379
- data/spec/fixtures/vcr_cassettes/assets.yml +0 -323003
- data/spec/fixtures/vcr_cassettes/info.yml +0 -374
- data/spec/fixtures/vcr_cassettes/jobs.yml +0 -621
- data/spec/fixtures/vcr_cassettes/no_jobs.yml +0 -0
- data/spec/fixtures/vcr_cassettes/no_tunnels.yml +0 -47
- data/spec/fixtures/vcr_cassettes/rest_request.yml +0 -0
- data/spec/fixtures/vcr_cassettes/storage.yml +0 -52
- data/spec/fixtures/vcr_cassettes/tunnels.yml +0 -331
- data/spec/fixtures/vcr_cassettes/tunnels_with_wait.yml +0 -393
- data/spec/lib/sauce_whisk/account_spec.rb +0 -43
- data/spec/lib/sauce_whisk/accounts_spec.rb +0 -136
- data/spec/lib/sauce_whisk/asset_spec.rb +0 -39
- data/spec/lib/sauce_whisk/assets_spec.rb +0 -61
- data/spec/lib/sauce_whisk/info_spec.rb +0 -66
- data/spec/lib/sauce_whisk/job_spec.rb +0 -137
- data/spec/lib/sauce_whisk/jobs_spec.rb +0 -140
- data/spec/lib/sauce_whisk/rest_request_builder_spec.rb +0 -167
- data/spec/lib/sauce_whisk/sauce_whisk_spec.rb +0 -139
- data/spec/lib/sauce_whisk/storage_spec.rb +0 -39
- data/spec/lib/sauce_whisk/subaccounts_spec.rb +0 -16
- data/spec/lib/sauce_whisk/tunnel_spec.rb +0 -32
- data/spec/lib/sauce_whisk/tunnels_spec.rb +0 -90
- data/spec/spec_helper.rb +0 -23
@@ -1,16 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe "a subaccount" do
|
4
|
-
let(:parent) {SauceWhisk::Account.new(:id => ENV["SAUCE_USERNAME"], :access_key => "12345", :minutes=>12)}
|
5
|
-
let(:params) {{:access_key => 12345, :minutes => 23, :id => "someone"}}
|
6
|
-
|
7
|
-
it "is an Account object" do
|
8
|
-
sub = SauceWhisk::SubAccount.new(parent, params)
|
9
|
-
expect( sub ).to be_a_kind_of SauceWhisk::Account
|
10
|
-
end
|
11
|
-
|
12
|
-
it "takes a parent as a parameter" do
|
13
|
-
sub = SauceWhisk::SubAccount.new(parent, params)
|
14
|
-
expect( sub.parent ).to be parent
|
15
|
-
end
|
16
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe SauceWhisk::Tunnel do
|
4
|
-
let(:params) {{
|
5
|
-
:id => "tunnel_id",
|
6
|
-
:owner => "test_user",
|
7
|
-
:status => "open",
|
8
|
-
:host => "yacko.wacko.dot",
|
9
|
-
:creation_time => Time.now
|
10
|
-
}}
|
11
|
-
|
12
|
-
describe "#new" do
|
13
|
-
it "sets all parameters passed in" do
|
14
|
-
tunnel = SauceWhisk::Tunnel.new params
|
15
|
-
expect( tunnel.id ).to eq "tunnel_id"
|
16
|
-
expect( tunnel.owner ).to eq "test_user"
|
17
|
-
expect( tunnel.status ).to eq "open"
|
18
|
-
expect( tunnel.host ).to eq "yacko.wacko.dot"
|
19
|
-
expect( tunnel.creation_time ).to eq params[:creation_time]
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
describe "#stop" do
|
24
|
-
it "calls the Repository class" do
|
25
|
-
tunnel = SauceWhisk::Tunnel.new params
|
26
|
-
expect( SauceWhisk::Tunnels ).to receive(:stop).with("tunnel_id")
|
27
|
-
|
28
|
-
tunnel.stop
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|
@@ -1,90 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe SauceWhisk::Tunnels, :vcr => {:cassette_name => "tunnels"} do
|
4
|
-
let(:auth) {"#{ENV["SAUCE_USERNAME"]}:#{ENV["SAUCE_ACCESS_KEY"]}"}
|
5
|
-
let(:user) {ENV["SAUCE_USERNAME"]}
|
6
|
-
|
7
|
-
describe "##all" do
|
8
|
-
it "lists all tunnels a user has open" do
|
9
|
-
SauceWhisk::Tunnels.all
|
10
|
-
assert_requested :get, "https://#{auth}@saucelabs.com/rest/v1/#{user}/tunnels"
|
11
|
-
end
|
12
|
-
|
13
|
-
it "returns nothing when no tunnels are found", :vcr => {:cassette_name => "no_tunnels", :exclusive => true} do
|
14
|
-
tunnels = SauceWhisk::Tunnels.all
|
15
|
-
expect( tunnels ).to eq []
|
16
|
-
end
|
17
|
-
|
18
|
-
context "called without the 'fetch' parameter" do
|
19
|
-
it "returns an array of Tunnels" do
|
20
|
-
tunnels = SauceWhisk::Tunnels.all
|
21
|
-
expect( tunnels ).to be_an_instance_of Array
|
22
|
-
tunnels.each {|tunnel| expect( tunnel ).to be_an_instance_of SauceWhisk::Tunnel}
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
context "called with the fetch parameter set false" do
|
27
|
-
it "returns an array of strings" do
|
28
|
-
tunnels = SauceWhisk::Tunnels.all(:fetch_each => false)
|
29
|
-
expect( tunnels ).to be_an_instance_of Array
|
30
|
-
tunnels.each {|tunnel| expect( tunnel ).to be_an_instance_of String }
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
describe "##fetch" do
|
36
|
-
let(:job_id) {"fcf7b980037b4a37aa5ff19808e46da7"}
|
37
|
-
it "fetches a single instance of a tunnel" do
|
38
|
-
SauceWhisk::Tunnels.fetch job_id
|
39
|
-
assert_requested :get, "https://#{auth}@saucelabs.com/rest/v1/#{user}/tunnels/#{job_id}"
|
40
|
-
end
|
41
|
-
|
42
|
-
it "returns instances of Tunnel" do
|
43
|
-
tunnel = SauceWhisk::Tunnels.fetch job_id
|
44
|
-
expect( tunnel ).to be_an_instance_of SauceWhisk::Tunnel
|
45
|
-
end
|
46
|
-
|
47
|
-
it "raises an exception with called without an id" do
|
48
|
-
expect {SauceWhisk::Tunnels.fetch(nil)}.to raise_exception ArgumentError
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
describe "##stop" do
|
53
|
-
it "calls the correct API method" do
|
54
|
-
tunnel_id = "7a4815f52407435581517ffd4d71c3a7"
|
55
|
-
SauceWhisk::Tunnels.stop tunnel_id
|
56
|
-
assert_requested :delete, "https://#{auth}@saucelabs.com/rest/v1/#{user}/tunnels/#{tunnel_id}"
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
describe "##open" do
|
61
|
-
let(:params) {{:tunnel_identifier => "bees", :ssh_port => 9123, :use_caching_proxy => false, :use_kgp => true}}
|
62
|
-
it "calls the correct API method" do
|
63
|
-
SauceWhisk::Tunnels.open params
|
64
|
-
assert_requested(:post, "https://#{auth}@saucelabs.com/rest/v1/#{user}/tunnels",:body => params.to_json)
|
65
|
-
end
|
66
|
-
|
67
|
-
it "returns an instance of tunnel" do
|
68
|
-
tunnel = SauceWhisk::Tunnels.open params
|
69
|
-
expect( tunnel ).to be_an_instance_of SauceWhisk::Tunnel
|
70
|
-
|
71
|
-
# These aren't magic, they're taken from the tunnels fixture. <3 VCR.
|
72
|
-
expect( tunnel.id ).to eq "4824d6b282e04d1184daff5401a52e1e"
|
73
|
-
expect( tunnel.ssh_port ).to eq 9123
|
74
|
-
end
|
75
|
-
|
76
|
-
context "When asked to wait until running", :vcr => {:cassette_name => 'tunnels_with_wait'} do
|
77
|
-
it "calls fetch on the opened tunnel until the status is running" do
|
78
|
-
requested_tunnel = SauceWhisk::Tunnels.open params
|
79
|
-
t_id = requested_tunnel.id
|
80
|
-
|
81
|
-
# There are 3 failing and 1 passing examples in the fixture
|
82
|
-
assert_requested :get, "https://#{auth}@saucelabs.com/rest/v1/#{user}/tunnels/#{t_id}", :times => 4
|
83
|
-
end
|
84
|
-
|
85
|
-
it "throws an exception if the timeout is exceeded" do
|
86
|
-
requested_tunnel = SauceWhisk::Tunnels.open params
|
87
|
-
end
|
88
|
-
end
|
89
|
-
end
|
90
|
-
end
|
data/spec/spec_helper.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
require "psych"
|
2
|
-
require "sauce_whisk"
|
3
|
-
require "webmock/rspec"
|
4
|
-
require "vcr"
|
5
|
-
|
6
|
-
puts "PSYCH: #{Psych::VERSION}"
|
7
|
-
|
8
|
-
|
9
|
-
VCR.configure do |config|
|
10
|
-
config.cassette_library_dir = "spec/fixtures/vcr_cassettes"
|
11
|
-
config.hook_into :webmock
|
12
|
-
config.configure_rspec_metadata!
|
13
|
-
config.default_cassette_options = {
|
14
|
-
:erb => true,
|
15
|
-
:record => :new_episodes
|
16
|
-
}
|
17
|
-
config.filter_sensitive_data("<SAUCE_USERNAME>") { ENV["SAUCE_USERNAME"] }
|
18
|
-
config.filter_sensitive_data("<SAUCE_ACCESS_KEY>") { ENV["SAUCE_ACCESS_KEY"] }
|
19
|
-
end
|
20
|
-
|
21
|
-
RSpec.configure do |config|
|
22
|
-
config.treat_symbols_as_metadata_keys_with_true_values = true
|
23
|
-
end
|