bluekai 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bluekai/request.rb +1 -1
- data/lib/bluekai/version.rb +1 -1
- data/spec/lib/bluekai/request_spec.rb +14 -0
- 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: 0ab05a08f6d1c160fd0284b4e66dc391ee7c4452
|
4
|
+
data.tar.gz: b47172a4caf1c536f0907ff134f3a13f602cced9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fce22f5d9d5f436b19fb7020c5ce49323c1f4b826eccf29c62a2f27011d1d3a77d343cdb475942cb43bf8acf18efa60d4c4a2d843a6d48912648b09b3a811da4
|
7
|
+
data.tar.gz: 9856dbcc5df2b9e5a60352af00b1f2f936c12600726fd73a989af30e58da79778eb4858c6b8b21d299f7323a9f447c0ee38d76f6b53a1d98c8c51bf3a6ee108d
|
data/lib/bluekai/request.rb
CHANGED
@@ -15,7 +15,7 @@ module Bluekai
|
|
15
15
|
|
16
16
|
def run
|
17
17
|
response = http_request
|
18
|
-
fail
|
18
|
+
fail Bluekai::RequestFailed, response.body unless response.code.start_with?('2')
|
19
19
|
return :success if response.body.nil? || response.body.strip.empty?
|
20
20
|
JSON.parse(response.body, symbolize_names: true)
|
21
21
|
end
|
data/lib/bluekai/version.rb
CHANGED
@@ -22,4 +22,18 @@ RSpec.describe Bluekai::Request do
|
|
22
22
|
expect(subject.signature).to eq('KOl1c80m2SQ6%2Fv5K0OLAUKejcrw6zXEsQ9crbcV6n3Y%3D')
|
23
23
|
end
|
24
24
|
end
|
25
|
+
|
26
|
+
describe '#run' do
|
27
|
+
let(:response_double) { double('response', body: 'user id not found', code: '404') }
|
28
|
+
let(:request_double) { double('request', response: response_double) }
|
29
|
+
|
30
|
+
subject { described_class.new('GET', '/error', {}, {}, 'https://services.bluekai.com') }
|
31
|
+
|
32
|
+
it 'fails with a Bluekai::RequestFailed exception when request fails' do
|
33
|
+
expect(HTTParty).to receive(:get).and_return(request_double)
|
34
|
+
|
35
|
+
subject.api_private_key = '1234'
|
36
|
+
expect { subject.run }.to raise_error(Bluekai::RequestFailed, /user id not found/)
|
37
|
+
end
|
38
|
+
end
|
25
39
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bluekai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ad2games GmbH
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|