Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added custom VCR matcher to ignore order of elements in XML body

  • Loading branch information...
commit a0ac7015a6b29aa3f592dd68eb8dfce859f404b0 1 parent 55de723
@tfwright tfwright authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 spec/spec_helper.rb
View
6 spec/spec_helper.rb
@@ -1,5 +1,6 @@
require 'rspec'
require 'vcr'
+require 'vcr_patch'
require 'fanny_pack'
def requires_ip(&block)
@@ -13,5 +14,8 @@ def requires_ip(&block)
VCR.configure do |c|
c.cassette_library_dir = 'spec/vcr_cassettes'
c.hook_into :fakeweb
- c.default_cassette_options = {:record => :none, :match_requests_on => [:body]}
+ c.default_cassette_options = {:record => :none, :match_requests_on => [:xml_body_without_order]}
+ c.register_request_matcher :xml_body_without_order do |request1, request2|
+ MultiXml.parse(request1.body) == MultiXml.parse(request2.body)
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.