bandiera-client 3.0.2 → 3.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -1
- data/HISTORY +4 -0
- data/lib/bandiera/client.rb +1 -2
- data/lib/bandiera/client/version.rb +1 -1
- data/spec/lib/bandiera/client_spec.rb +9 -27
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d59a3e5cb3cf23e4137715345e15df7499e00e48
|
4
|
+
data.tar.gz: 1165f18f168f53e8695c575859b0ae841d9ac789
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7b6ace839926487e8f938c4511e71ee7e96aaf69521094187e4005e73d548ffe6c1ce5dcd51f1a66309b199c15a573011abc84ed28abda38a36f61ce1e38bc0
|
7
|
+
data.tar.gz: ae4a2f37b35d439ede1d9de7965665d6ddd443f544efb5c3ffa3549faba78c204f33ccb1b40461f6a2556b7b3ae991517cba8714cf78793efb735eaf3ee9d3e8
|
data/.travis.yml
CHANGED
data/HISTORY
CHANGED
data/lib/bandiera/client.rb
CHANGED
@@ -116,8 +116,7 @@ module Bandiera
|
|
116
116
|
logger.debug("#{error_msg_prefix} - #{res['warning']}") if res['warning']
|
117
117
|
block.call(res['response']) if block
|
118
118
|
res['response']
|
119
|
-
rescue *EXCEPTIONS_TO_HANDLE
|
120
|
-
logger.warn("#{error_msg_prefix} - #{error.class} - #{error.message}")
|
119
|
+
rescue *EXCEPTIONS_TO_HANDLE
|
121
120
|
return_upon_error
|
122
121
|
end
|
123
122
|
|
@@ -81,11 +81,9 @@ describe Bandiera::Client do
|
|
81
81
|
end
|
82
82
|
|
83
83
|
context 'bandiera is down' do
|
84
|
-
it 'returns a default response
|
84
|
+
it 'returns a default response' do
|
85
85
|
stub_request(:get, url).to_return(status: [0, ''])
|
86
86
|
|
87
|
-
expect(logger).to receive(:warn).once
|
88
|
-
|
89
87
|
response = subject.get_feature(group, feature)
|
90
88
|
|
91
89
|
expect(response).to be false
|
@@ -93,11 +91,9 @@ describe Bandiera::Client do
|
|
93
91
|
end
|
94
92
|
|
95
93
|
context 'bandiera is having some problems' do
|
96
|
-
it 'returns a default response
|
94
|
+
it 'returns a default response' do
|
97
95
|
stub_request(:get, url).to_return(status: 500, body: '')
|
98
96
|
|
99
|
-
expect(logger).to receive(:warn).once
|
100
|
-
|
101
97
|
response = subject.get_feature(group, feature)
|
102
98
|
|
103
99
|
expect(response).to be false
|
@@ -105,11 +101,9 @@ describe Bandiera::Client do
|
|
105
101
|
end
|
106
102
|
|
107
103
|
context 'bandiera times out' do
|
108
|
-
it 'returns a default response
|
104
|
+
it 'returns a default response' do
|
109
105
|
stub_request(:get, url).to_timeout
|
110
106
|
|
111
|
-
expect(logger).to receive(:warn).once
|
112
|
-
|
113
107
|
response = subject.get_feature(group, feature)
|
114
108
|
|
115
109
|
expect(response).to be false
|
@@ -162,11 +156,9 @@ describe Bandiera::Client do
|
|
162
156
|
end
|
163
157
|
|
164
158
|
context 'bandiera is down' do
|
165
|
-
it 'returns a default response
|
159
|
+
it 'returns a default response' do
|
166
160
|
stub_request(:get, url).to_return(status: [0, ''])
|
167
161
|
|
168
|
-
expect(logger).to receive(:warn).once
|
169
|
-
|
170
162
|
response = subject.get_features_for_group(group)
|
171
163
|
|
172
164
|
expect(response).to be {}
|
@@ -174,11 +166,9 @@ describe Bandiera::Client do
|
|
174
166
|
end
|
175
167
|
|
176
168
|
context 'bandiera is having some problems' do
|
177
|
-
it 'returns a default response
|
169
|
+
it 'returns a default response' do
|
178
170
|
stub_request(:get, url).to_return(status: 500, body: '')
|
179
171
|
|
180
|
-
expect(logger).to receive(:warn).once
|
181
|
-
|
182
172
|
response = subject.get_features_for_group(group)
|
183
173
|
|
184
174
|
expect(response).to be {}
|
@@ -186,11 +176,9 @@ describe Bandiera::Client do
|
|
186
176
|
end
|
187
177
|
|
188
178
|
context 'bandiera times out' do
|
189
|
-
it 'returns a default response
|
179
|
+
it 'returns a default response' do
|
190
180
|
stub_request(:get, url).to_timeout
|
191
181
|
|
192
|
-
expect(logger).to receive(:warn).once
|
193
|
-
|
194
182
|
response = subject.get_features_for_group(group)
|
195
183
|
|
196
184
|
expect(response).to be {}
|
@@ -242,11 +230,9 @@ describe Bandiera::Client do
|
|
242
230
|
end
|
243
231
|
|
244
232
|
context 'bandiera is down' do
|
245
|
-
it 'returns a default response
|
233
|
+
it 'returns a default response' do
|
246
234
|
stub_request(:get, url).to_return(status: [0, ''])
|
247
235
|
|
248
|
-
expect(logger).to receive(:warn).once
|
249
|
-
|
250
236
|
response = subject.get_all
|
251
237
|
|
252
238
|
expect(response).to be {}
|
@@ -254,11 +240,9 @@ describe Bandiera::Client do
|
|
254
240
|
end
|
255
241
|
|
256
242
|
context 'bandiera is having some problems' do
|
257
|
-
it 'returns a default response
|
243
|
+
it 'returns a default response' do
|
258
244
|
stub_request(:get, url).to_return(status: 200, body: '<html></html>')
|
259
245
|
|
260
|
-
expect(logger).to receive(:warn).once
|
261
|
-
|
262
246
|
response = subject.get_all
|
263
247
|
|
264
248
|
expect(response).to be {}
|
@@ -266,11 +250,9 @@ describe Bandiera::Client do
|
|
266
250
|
end
|
267
251
|
|
268
252
|
context 'bandiera times out' do
|
269
|
-
it 'returns a default response
|
253
|
+
it 'returns a default response' do
|
270
254
|
stub_request(:get, url).to_timeout
|
271
255
|
|
272
|
-
expect(logger).to receive(:warn).once
|
273
|
-
|
274
256
|
response = subject.get_all
|
275
257
|
|
276
258
|
expect(response).to be {}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bandiera-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Springer Nature
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|