equivalent-xml 0.4.3 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/LICENSE.txt +2 -2
- data/README.md +15 -8
- data/lib/equivalent-xml/rspec_matchers.rb +10 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MjZkNWNmMGY5ZGUzOTNkYzMwYWUxOGVmODljYzgyMTgzZjc4YzEyMw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Mjk5ZjM4ZTA0N2UwNWJjNjI3ZGRlNTk2OTk0M2UyZGUxYzE5NTNiYw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YTYxODA2Y2ZjNDFjZWM3OGY0MTA3MmJiNzgxMTBlZWRhMTg4NzY4M2Q3YTc0
|
10
|
+
NTJmMjM0YWFjNGFlOGZmZmRiNTI5NzQ3ZWMyNDM5ZjJiZjZkYjJiMjBhMTEz
|
11
|
+
NmFhNGU0ZGQ1MjhlZWJjOWY4N2Q1NzhhNTIwNTAyNWFlODFjNjg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Y2EyYjA5MDQ3N2UzOTQ3MGFiMDU3ODdjNTdmYWY2ZGU3OTc4ZDNhYWEyMjYy
|
14
|
+
MmQzNGU3ZDIzYzI0MTJkNGQzZjI1NGY5YzJmZjc2MjQ1YmY2YjgxYzc1OGU0
|
15
|
+
MDY1YzVlMzcxYmQzMjNiM2E0MGQxOTA4ODg5NDYxYzY4MjY5MTU=
|
data/LICENSE.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c) 2011 Michael B. Klein
|
1
|
+
Copyright (c) 2011-14 Michael B. Klein
|
2
2
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining
|
4
4
|
a copy of this software and associated documentation files (the
|
@@ -17,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
17
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
18
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
19
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -81,17 +81,24 @@ nodes) should be ignored when comparing for equivalence. Defaults to `nil`. (U
|
|
81
81
|
EquivalentXml includes a custom matcher for RSpec (version >=1.2.4) that makes including XML
|
82
82
|
equivalencies in your spec tests a cinch!
|
83
83
|
|
84
|
+
Add below two line to `spec_helper.rb`:
|
85
|
+
|
86
|
+
```ruby
|
87
|
+
require 'rspec/matchers' # req by equivalent-xml custom matcher `be_equivalent_to`
|
88
|
+
require 'equivalent-xml'
|
89
|
+
```
|
90
|
+
|
84
91
|
Equivalency:
|
85
92
|
|
86
|
-
node_1.
|
87
|
-
node_1.
|
93
|
+
expect(node_1).to be_equivalent_to(node_2)
|
94
|
+
expect(node_1).not_to be_equivalent_to(node_2)
|
88
95
|
|
89
96
|
Chained modifiers:
|
90
97
|
|
91
|
-
node_1.
|
92
|
-
node_1.
|
93
|
-
node_1.
|
94
|
-
node_1.
|
98
|
+
expect(node_1).to be_equivalent_to(node_2).respecting_element_order
|
99
|
+
expect(node_1).to be_equivalent_to(node_2).with_whitespace_intact
|
100
|
+
expect(node_1).to be_equivalent_to(node_2).respecting_element_order.with_whitespace_intact
|
101
|
+
expect(node_1).to be_equivalent_to(node_2).ignoring_content_of("SerialNumber")
|
95
102
|
|
96
103
|
## Contributing to equivalent-xml
|
97
104
|
|
@@ -106,6 +113,7 @@ Chained modifiers:
|
|
106
113
|
|
107
114
|
## History
|
108
115
|
|
116
|
+
- <b>0.4.4</b> - Fix rspec 3 deprecation warnings while maintaining compatibility with rspec 1 & 2 (w/assist from barelyknown & DanielHeath)
|
109
117
|
- <b>0.4.3</b> - Updates for rspec 3
|
110
118
|
- <b>0.4.2</b> - Move version back into gemspec for now
|
111
119
|
- <b>0.4.1</b> - Improved RSpec version checking (contrib. by elandesign)
|
@@ -131,5 +139,4 @@ Chained modifiers:
|
|
131
139
|
|
132
140
|
## Copyright
|
133
141
|
|
134
|
-
Copyright (c) 2011 Michael B. Klein. See LICENSE.txt for further details.
|
135
|
-
|
142
|
+
Copyright (c) 2011-14 Michael B. Klein. See LICENSE.txt for further details.
|
@@ -50,13 +50,21 @@ module EquivalentXml::RSpecMatchers
|
|
50
50
|
opts[:ignore_attr_values] = true
|
51
51
|
end
|
52
52
|
|
53
|
-
|
53
|
+
should_message = lambda do |actual|
|
54
54
|
[ 'expected:', expected.to_s, 'got:', actual.to_s ].join("\n")
|
55
55
|
end
|
56
56
|
|
57
|
-
|
57
|
+
should_not_message = lambda do |actual|
|
58
58
|
[ 'expected:', actual.to_s, 'not to be equivalent to:', expected.to_s ].join("\n")
|
59
59
|
end
|
60
|
+
|
61
|
+
if respond_to?(:failure_message_when_negated)
|
62
|
+
failure_message &should_message
|
63
|
+
failure_message_when_negated &should_not_message
|
64
|
+
else
|
65
|
+
failure_message_for_should &should_message
|
66
|
+
failure_message_for_should_not &should_not_message
|
67
|
+
end
|
60
68
|
end
|
61
69
|
|
62
70
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: equivalent-xml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael B. Klein
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|