From 8a8bb50fba1b3c6acb232754e7211f855d39d3e4 Mon Sep 17 00:00:00 2001 From: Eric Guo Date: Wed, 18 Jun 2014 00:21:30 +0800 Subject: [PATCH 1/2] Add instruction to require rspec/matchers, otherwise will cause below error. https://github.com/savonrb/savon/pull/586 --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 3c657a7..664dcc3 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,13 @@ nodes) should be ignored when comparing for equivalence. Defaults to `nil`. (U EquivalentXml includes a custom matcher for RSpec (version >=1.2.4) that makes including XML equivalencies in your spec tests a cinch! +Add below two line to `spec_helper.rb`: + +```ruby +require 'rspec/matchers' # req by equivalent-xml custom matcher `be_equivalent_to` +require 'equivalent-xml' +``` + Equivalency: node_1.should be_equivalent_to(node_2) From 7616171071a7b14a8632baef16382e924bccdeca Mon Sep 17 00:00:00 2001 From: Eric Guo Date: Wed, 18 Jun 2014 00:22:27 +0800 Subject: [PATCH 2/2] Now the Rspec prefer expect instead of should, so change the document also. --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 664dcc3..1722633 100644 --- a/README.md +++ b/README.md @@ -90,15 +90,15 @@ require 'equivalent-xml' Equivalency: - node_1.should be_equivalent_to(node_2) - node_1.should_not be_equivalent_to(node_2) + expect(node_1).to be_equivalent_to(node_2) + expect(node_1).not_to be_equivalent_to(node_2) Chained modifiers: - node_1.should be_equivalent_to(node_2).respecting_element_order - node_1.should be_equivalent_to(node_2).with_whitespace_intact - node_1.should be_equivalent_to(node_2).respecting_element_order.with_whitespace_intact - node_1.should be_equivalent_to(node_2).ignoring_content_of("SerialNumber") + expect(node_1).to be_equivalent_to(node_2).respecting_element_order + expect(node_1).to be_equivalent_to(node_2).with_whitespace_intact + expect(node_1).to be_equivalent_to(node_2).respecting_element_order.with_whitespace_intact + expect(node_1).to be_equivalent_to(node_2).ignoring_content_of("SerialNumber") ## Contributing to equivalent-xml