stacker_bee 2.1.0.pre195 → 2.1.0.pre196
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZGJiNzgyOGVhMjIyNzYxZmVkOTE0OWE4MDUzYTAzNzQ0ODY4MTA4Mw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZWU2ZTQ3NGQ2YjRmMGJiM2EwNzdmY2RiM2E5N2JhM2ZlMDRiOWVhNg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YTVjYTMxN2ZiYWFjMTJiNjZhNDdjMjNhNGUwYTQ2ZmQ3YjdmYTYwMGNhMTYz
|
10
|
+
ZDBjYjRmNjAyN2MwNmZkY2U3NTBlZmVhZmI4MjBmZDY2YmYzNjUzMWJlOWZi
|
11
|
+
YTQ3MDU2NzFlY2QyNGMwMjZkOTkxMDlmNmQyMTY0YTNmYTk5NTU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODNlZGE1ZWRkODkyYWQ2MmQ4YjEzOWQ0NWFkYWRiOTg3MjBiZmRiNDNmOWMz
|
14
|
+
OWU0ODA3MGRiZDA1ZDIwNDk5M2Q3ZmJmODQ0YmViODI4MjEyNDhiM2E1ZDc0
|
15
|
+
MzMxMDQ2YTY5NmQ5NDhhODBkZjU0YTIxYTY4MzU5N2I2YTI2MTE=
|
@@ -19,7 +19,7 @@ module StackerBee
|
|
19
19
|
|
20
20
|
initialize_faraday(
|
21
21
|
url: uri.to_s,
|
22
|
-
ssl: { verify: ssl_verify? }
|
22
|
+
ssl: { verify: configuration.ssl_verify? }
|
23
23
|
)
|
24
24
|
end
|
25
25
|
|
@@ -48,13 +48,5 @@ module StackerBee
|
|
48
48
|
raise ConnectionError,
|
49
49
|
"Failed to connect to #{configuration.url}, #{error}"
|
50
50
|
end
|
51
|
-
|
52
|
-
def ssl_verify?
|
53
|
-
if !configuration.ssl_verify.nil?
|
54
|
-
configuration.ssl_verify
|
55
|
-
else
|
56
|
-
true
|
57
|
-
end
|
58
|
-
end
|
59
51
|
end
|
60
52
|
end
|
@@ -4,4 +4,22 @@ describe StackerBee::Configuration do
|
|
4
4
|
its(:url) { should be_nil }
|
5
5
|
its(:api_key) { should be_nil }
|
6
6
|
its(:secret_key) { should be_nil }
|
7
|
+
|
8
|
+
describe "#ssl_verify?" do
|
9
|
+
subject { configuration.ssl_verify? }
|
10
|
+
let(:configuration) { described_class.new(ssl_verify: ssl_verify) }
|
11
|
+
|
12
|
+
context "when nil" do
|
13
|
+
let(:ssl_verify) { nil }
|
14
|
+
it { should eq true }
|
15
|
+
end
|
16
|
+
context "when false" do
|
17
|
+
let(:ssl_verify) { false }
|
18
|
+
it { should eq false }
|
19
|
+
end
|
20
|
+
context "when true" do
|
21
|
+
let(:ssl_verify) { true }
|
22
|
+
it { should eq true }
|
23
|
+
end
|
24
|
+
end
|
7
25
|
end
|
@@ -4,15 +4,20 @@ describe StackerBee::Connection do
|
|
4
4
|
subject(:get) { connection.get(path, query_params) }
|
5
5
|
before { Faraday.stub new: faraday }
|
6
6
|
|
7
|
-
let(:url)
|
8
|
-
let(:path)
|
9
|
-
let(:secret_key)
|
10
|
-
let(:query_params)
|
11
|
-
let(:response)
|
12
|
-
let(:faraday)
|
13
|
-
let(:connection)
|
7
|
+
let(:url) { "http://test.com:1234/foo/bar/" }
|
8
|
+
let(:path) { "/foo/bar" }
|
9
|
+
let(:secret_key) { "shhh" }
|
10
|
+
let(:query_params) { [[:foo, :bar]] }
|
11
|
+
let(:response) { double(:response) }
|
12
|
+
let(:faraday) { double(:faraday, get: response) }
|
13
|
+
let(:connection) { described_class.new(configuration) }
|
14
|
+
let(:ssl_verify) { true }
|
14
15
|
let(:configuration) do
|
15
|
-
|
16
|
+
StackerBee::Configuration.new(
|
17
|
+
url: url,
|
18
|
+
secret_key: secret_key,
|
19
|
+
ssl_verify: ssl_verify
|
20
|
+
)
|
16
21
|
end
|
17
22
|
|
18
23
|
context "successfully connecting" do
|
@@ -52,9 +57,7 @@ describe StackerBee::Connection do
|
|
52
57
|
end
|
53
58
|
|
54
59
|
context "when verifying an ssl connection" do
|
55
|
-
let(:
|
56
|
-
double(url: url, secret_key: secret_key, ssl_verify: false)
|
57
|
-
end
|
60
|
+
let(:ssl_verify) { false }
|
58
61
|
it "specifies the ssl verify option when creating a connection" do
|
59
62
|
get
|
60
63
|
Faraday.should have_received(:new).with(url: "http://test.com:1234",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stacker_bee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.0.
|
4
|
+
version: 2.1.0.pre196
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg Sterndale
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-04-
|
12
|
+
date: 2014-04-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|