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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 774cef3b18775e0f088571f7d474faf5646202ba
4
- data.tar.gz: f9e04b63d36e4e3c9b7d9742fad2d12a2d1060f3
3
+ metadata.gz: 0ab05a08f6d1c160fd0284b4e66dc391ee7c4452
4
+ data.tar.gz: b47172a4caf1c536f0907ff134f3a13f602cced9
5
5
  SHA512:
6
- metadata.gz: 6345648e62bcd0ecba25bca44b82a09167ff2ab5a90173251f153021189e7d80dd957220cab30fff2c36ed3b9a0a24f772e3385c3b6e76f009e89d7bc03b4734
7
- data.tar.gz: 90670e389cb1e762c5734c65b1bd8ae69265d88266c5dd7655a656f452aa2fd4f7a12c117b8258cc0928dc5eb24c4d3f0595429d41af0b7692d6a23b7924b74e
6
+ metadata.gz: fce22f5d9d5f436b19fb7020c5ce49323c1f4b826eccf29c62a2f27011d1d3a77d343cdb475942cb43bf8acf18efa60d4c4a2d843a6d48912648b09b3a811da4
7
+ data.tar.gz: 9856dbcc5df2b9e5a60352af00b1f2f936c12600726fd73a989af30e58da79778eb4858c6b8b21d299f7323a9f447c0ee38d76f6b53a1d98c8c51bf3a6ee108d
@@ -15,7 +15,7 @@ module Bluekai
15
15
 
16
16
  def run
17
17
  response = http_request
18
- fail "HTTP Request Error: #{response.body}" unless response.code.start_with?('2')
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
@@ -1,3 +1,3 @@
1
1
  module Bluekai
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
@@ -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.5
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-06-04 00:00:00.000000000 Z
11
+ date: 2015-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty