Permalink
Browse files

[excon] stubbed_response should return hash instead of struct

  • Loading branch information...
1 parent 113487e commit 2b7ed5f2640a86dae3316c5b7eb0ff3ea072e33f @geemus geemus committed with Jul 13, 2011
Showing with 7 additions and 7 deletions.
  1. +7 −7 lib/vcr/http_stubbing_adapters/excon.rb
View
14 lib/vcr/http_stubbing_adapters/excon.rb
@@ -119,15 +119,15 @@ def request_should_be_ignored?
end
def stubbed_response
- unless defined?(@stubbed_response)
- @stubbed_response = VCR::HttpStubbingAdapters::Excon.stubbed_response_for(vcr_request)
-
- if @stubbed_response && @stubbed_response.headers
- @stubbed_response.headers = normalized_headers(@stubbed_response.headers)
+ @stubbed_response ||= begin
+ if stubbed_response = VCR::HttpStubbingAdapters::Excon.stubbed_response_for(vcr_request)
+ {
+ :body => stubbed_response.body,
+ :headers => normalized_headers(stubbed_response.headers || {}),
+ :status => stubbed_response.status.code
+ }
end
end
-
- @stubbed_response
end
def http_connections_allowed?

0 comments on commit 2b7ed5f

Please sign in to comment.