sauce_whisk 0.0.18 → 0.0.19

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c06558c998bebee55ffeb54f939eb943226df5c
4
- data.tar.gz: 364146facb4967133f6c185c04047da134b4f4cb
3
+ metadata.gz: 580cc7466c29d1ed8d8504c6afb3cb80354884c8
4
+ data.tar.gz: 043b5e0f5b53be3599349913b0d8926e0abc95aa
5
5
  SHA512:
6
- metadata.gz: ecfc79550e42cc21f1bdf1272fb81d1af1ccd011bc45ced2b795cba6fced8e911cb8359272430353be66c6c2ddb065e221c15415eb739a6e4ce53aaa0c0ffa70
7
- data.tar.gz: 53322585638866c7da9aef5090fb4b361869f2afa439ecba1ab884e49ff919e788d39ca09d2107b352136ebe31ba04dd0355ffc69db48737c8b3c41a8fec8c28
6
+ metadata.gz: 54942e8ed65c2c4a7e1f82848ba1cb06c080c20e2427b9b78019acc833cfabb700a2a81df1ce3d54b6956aef46c4c52d9cb97e045b800e3b9467d195f4a838ef
7
+ data.tar.gz: 4c2dc81b0a7a7281bb926006f43e9ecb7d4fb0ab7d652d78da16e7f4b2fd48e41b1b9c2d838015e89270bb63080af0ecb5a1cdc9f13f103bd2c1bddc64431f51
data/README.md CHANGED
@@ -36,11 +36,12 @@ You'll need a [Sauce Labs account](http://wwww.saucelabs.com/signup). They're f
36
36
 
37
37
 
38
38
  ### Locations
39
- There are three ways to configure SauceWhisk. The gem tries each of the following locations in turn.
39
+ There are four ways to configure SauceWhisk. The gem tries each of the following locations in turn. Note, Environment Variables are the preferred means of setting configuration.
40
40
 
41
41
  #### Directly on the SauceWhisk object
42
- `asset_fetch_retries` and `rest_retries` can be set directly on the SauceWhisk object:
42
+ `username`, `access_key`, `asset_fetch_retries` and `rest_retries` can be set directly on the SauceWhisk object:
43
43
  ```ruby
44
+ SauceWhisk.username = 'some_rad_tester'
44
45
  SauceWhisk.asset_fetch_retries = 5
45
46
  ```
46
47
 
@@ -1,4 +1,8 @@
1
1
  # Major Version 0
2
+ ### 0.0.19
3
+ * You can now configure SauceWhisk.username and SauceWhisk.access_key. These values override all other configuration settings
4
+ * Removed Content-Type header from PUT commands as per documentation
5
+
2
6
  ### 0.0.18
3
7
  * @tommeier is a champion and bumped rest_client to 1.8.0 to avoid a security flaw (Fixes #42).
4
8
 
@@ -17,6 +17,14 @@ module SauceWhisk
17
17
  "https://saucelabs.com/rest/v1"
18
18
  end
19
19
 
20
+ def self.username= username
21
+ @username = username
22
+ end
23
+
24
+ def self.access_key= access_key
25
+ @access_key = access_key
26
+ end
27
+
20
28
  def self.username
21
29
  return self.load_first_found(:username)
22
30
  end
@@ -98,8 +106,14 @@ module SauceWhisk
98
106
  end
99
107
 
100
108
  def self.load_first_found(key)
101
- value = ::Sauce::Config.new[key] if defined? ::Sauce
109
+ value = self.instance_variable_get "@#{key}".to_sym
110
+
111
+ unless value
112
+ value = ::Sauce::Config.new[key] if defined? ::Sauce
113
+ end
114
+
102
115
  value = self.from_yml(key) unless value
116
+
103
117
  unless value
104
118
  env_key = "SAUCE_#{key.to_s.upcase}"
105
119
  value = ENV[env_key]
@@ -20,7 +20,7 @@ module SauceWhisk
20
20
  :method => :put,
21
21
  :url => url,
22
22
  :payload => body,
23
- :content_type => "application/json",
23
+ :content_type => :json,
24
24
  :headers => headers
25
25
  }
26
26
  make_request(req_params.merge auth_details)
@@ -1,3 +1,3 @@
1
1
  module SauceWhisk
2
- VERSION = "0.0.18"
2
+ VERSION = "0.0.19"
3
3
  end
@@ -19,10 +19,10 @@ Gem::Specification.new do |gem|
19
19
 
20
20
  gem.license = 'MIT'
21
21
 
22
- gem.add_runtime_dependency 'rest-client', '~> 1.7'
22
+ gem.add_runtime_dependency 'rest-client', '~> 1.8.0'
23
23
  gem.add_runtime_dependency 'json', '~> 1.8.1'
24
24
  gem.add_development_dependency 'vcr', '~> 2.9.0'
25
- gem.add_development_dependency 'webmock', '~> 1.18.0'
26
- gem.add_development_dependency 'rspec', '~> 3.0.0'
27
- gem.add_development_dependency 'rake', '~> 10.3.2'
25
+ gem.add_development_dependency 'webmock', '~> 1.21.0'
26
+ gem.add_development_dependency 'rspec', '~> 3.3.0'
27
+ gem.add_development_dependency 'rake', '~> 10.4.2'
28
28
  end
@@ -24,7 +24,7 @@ describe SauceWhisk::Jobs do
24
24
  it "passes a test status to the REST api" do
25
25
  job_id = "bd9c43dd6b5549f1b942d1d581d98cac"
26
26
  SauceWhisk::Jobs.change_status job_id, true
27
- assert_requested :put, "https://#{auth}@saucelabs.com/rest/v1/#{user}/jobs/#{job_id}", :body => pass_string, :content_type => "application/json"
27
+ assert_requested :put, "https://#{auth}@saucelabs.com/rest/v1/#{user}/jobs/#{job_id}", :body => pass_string
28
28
  end
29
29
  end
30
30
 
@@ -51,7 +51,7 @@ describe SauceWhisk::Jobs do
51
51
  job_id = "bd9c43dd6b5549f1b942d1d581d98cac"
52
52
  job = SauceWhisk::Job.new({:id => job_id})
53
53
  SauceWhisk::Jobs.save (job)
54
- assert_requested :put, "https://#{auth}@saucelabs.com/rest/v1/#{user}/jobs/#{job.id}", :body => anything, :content_type => "application/json"
54
+ assert_requested :put, "https://#{auth}@saucelabs.com/rest/v1/#{user}/jobs/#{job.id}", :body => anything
55
55
  end
56
56
 
57
57
  it "only sends updated information" do
@@ -60,7 +60,7 @@ describe SauceWhisk::Jobs do
60
60
  job.name = "Updated Name"
61
61
  SauceWhisk::Jobs.save (job)
62
62
  expected_body = {:name => "Updated Name"}.to_json
63
- assert_requested :put, "https://#{auth}@saucelabs.com/rest/v1/#{user}/jobs/#{job.id}", :body => expected_body, :content_type => "application/json"
63
+ assert_requested :put, "https://#{auth}@saucelabs.com/rest/v1/#{user}/jobs/#{job.id}", :body => expected_body
64
64
  end
65
65
  end
66
66
 
@@ -116,7 +116,7 @@ describe SauceWhisk::Jobs do
116
116
  describe "##stop", :vcr => {:cassette_name => "jobs"} do
117
117
  it "calls the API correctly" do
118
118
  SauceWhisk::Jobs.stop "3edc8fe6d52645bf931b1003da65af1f"
119
- assert_requested :put, "https://#{auth}@saucelabs.com/rest/v1/#{user}/jobs/3edc8fe6d52645bf931b1003da65af1f/stop", :content_type => "application/json"
119
+ assert_requested :put, "https://#{auth}@saucelabs.com/rest/v1/#{user}/jobs/3edc8fe6d52645bf931b1003da65af1f/stop"
120
120
  end
121
121
 
122
122
  it "does something interesting when the job is already stopped" do
@@ -144,11 +144,6 @@ end
144
144
  dummy_client.put "something", "another_thing"
145
145
  end
146
146
 
147
- it "includes the right content_type" do
148
- expect( RestClient::Request ).to receive(:execute).with(hash_including({:content_type => "application/json"}))
149
- dummy_client.put "something", "another_thing"
150
- end
151
-
152
147
  it "includes the right method" do
153
148
  expect( RestClient::Request ).to receive(:execute).with(hash_including({:method => :put}))
154
149
  dummy_client.put "something", "another_thing"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sauce_whisk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.18
4
+ version: 0.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dylan Lacey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-17 00:00:00.000000000 Z
11
+ date: 2015-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.7'
19
+ version: 1.8.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.7'
26
+ version: 1.8.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: json
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -58,42 +58,42 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 1.18.0
61
+ version: 1.21.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 1.18.0
68
+ version: 1.21.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 3.0.0
75
+ version: 3.3.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 3.0.0
82
+ version: 3.3.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 10.3.2
89
+ version: 10.4.2
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 10.3.2
96
+ version: 10.4.2
97
97
  description: A Wrapper for the Sauce Labs REST API.
98
98
  email:
99
99
  - github@dylanlacey.com