redvine 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -61,7 +61,11 @@ class Redvine
61
61
 
62
62
  def get_request_data(endpoint, records=true)
63
63
  response = HTTParty.get(@@baseUrl + endpoint, {headers: session_headers})
64
- records ? Hashie::Mash.new(response.parsed_response).data.records : Hashie::Mash.new(response.parsed_response).data
64
+ if response.parsed_response['success'] == false
65
+ return Hashie::Mash.new(response.parsed_response)
66
+ else
67
+ records ? Hashie::Mash.new(response.parsed_response).data.records : Hashie::Mash.new(response.parsed_response).data
68
+ end
65
69
  end
66
70
 
67
71
  end
@@ -1,3 +1,3 @@
1
1
  class Redvine
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -161,6 +161,14 @@ describe Redvine do
161
161
  end
162
162
  end
163
163
 
164
+ it 'should not break if an error is returned from Vine' do
165
+ VCR.use_cassette('redvine', :record => :new_episodes) do
166
+ client = setup_client()
167
+ vines = client.user_timeline('965095451261071400')
168
+ expect(vines.success).to be_false
169
+ end
170
+ end
171
+
164
172
  end
165
173
 
166
174
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redvine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-05 00:00:00.000000000 Z
12
+ date: 2013-07-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty