Skip to content

Commit

Permalink
Fix 1.8.7 compatibility.
Browse files Browse the repository at this point in the history
- On 1.8, #instance_variables returns an array of strings.
- On 1.9, #instance_variables returns an array of symbols.
  • Loading branch information
myronmarston committed May 26, 2012
1 parent aa087c1 commit 524ac1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/vcr/library_hooks/webmock.rb
Expand Up @@ -46,7 +46,7 @@ def request_headers_for(webmock_request)
end

def typed_request_for(webmock_request, remove = false)
if webmock_request.instance_variables.include?(:@__typed_vcr_request)
if webmock_request.instance_variables.find { |v| v.to_sym == :@__typed_vcr_request }
meth = remove ? :remove_instance_variable : :instance_variable_get
return webmock_request.send(meth, :@__typed_vcr_request)
end
Expand Down

0 comments on commit 524ac1c

Please sign in to comment.