Skip to content

Commit 1a5724b

Browse files
committed
support the most recent httparty gem
1 parent 1558cf6 commit 1a5724b

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

Gemfile.lock

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@ PATH
88
GEM
99
remote: http://rubygems.org/
1010
specs:
11-
crack (0.1.8)
11+
crack (0.3.2)
1212
diff-lcs (1.1.2)
1313
fakeweb (1.3.0)
14-
httparty (0.7.4)
15-
crack (= 0.1.8)
14+
httparty (0.10.2)
15+
multi_json (~> 1.0)
16+
multi_xml (>= 0.5.2)
17+
multi_json (1.6.1)
18+
multi_xml (0.5.3)
1619
rspec (2.5.0)
1720
rspec-core (~> 2.5.0)
1821
rspec-expectations (~> 2.5.0)
@@ -27,8 +30,6 @@ PLATFORMS
2730

2831
DEPENDENCIES
2932
bundler (>= 1.0.0)
30-
crack
3133
fakeweb
32-
httparty
3334
rspec
3435
ruby-pardot!

lib/pardot/http.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ def check_response http_response
4747

4848
error = rsp["err"] if rsp
4949
error ||= "Unknown Failure: #{rsp.inspect}" if rsp && rsp["stat"] == "fail"
50+
content = error['__content__'] if error.is_a?(Hash)
5051

51-
if error == "Invalid API key or user key" && @api_key
52+
if [error, content].include?("Invalid API key or user key") && @api_key
5253
raise ExpiredApiKeyError.new @api_key
5354
end
5455

spec/spec_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
require 'ruby-pardot'
1010

11-
Dir[File.join("spec/support/**/*.rb")].each {|f| require f}
11+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }

0 commit comments

Comments
 (0)