minitest-extra-matchers 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 00c6562b5b477b2028a69a529c7b8b4687759d74
4
- data.tar.gz: 7b31012c1938427aa97be448a2d91da4b4db330e
3
+ metadata.gz: b5b749ec718a10b4038a921197d03cf0d4481a1a
4
+ data.tar.gz: 6b9576c4caedd4943a53e0cc15d24a39847edbca
5
5
  SHA512:
6
- metadata.gz: b278ca5d70954dff910496e5047306ed9eb20a79dc794c77721e277f49aa839ac29c84830332e3923ee23892b682471d9f7166bc2db1a5a5def70c4c6bb73984
7
- data.tar.gz: 0e0d91902d40b8b57c5917ec186e7c9ab2318806172f5013753069422bfd40aa0c87b392b237d723814dce3408c7217743a55619291afa63a459878e2a73f064
6
+ metadata.gz: 4061fed01eb293a0b6d5da74ddda14c18cd0db07a6996fcbb35b552d733cdf316ed9e1bdf908d2fbb46bdd6e55846c526664d2d8d4d48739583c7181b43a5907
7
+ data.tar.gz: 22246bba14591bb81251644ffd2429dc90d62b0f5d443a048caadd3bcd1e73937b7d80b66279f128e8f8086d92eebe370e576ebb355cba0fa43699e5d545a95e
@@ -1,3 +1,5 @@
1
+ require 'equivalent-xml'
2
+
1
3
  module Minitest
2
4
  module Extra
3
5
  module Matchers
@@ -7,11 +9,14 @@ module Minitest
7
9
  Object.infect_an_assertion :assert_attr_equal, :must_have_attr
8
10
  end
9
11
 
10
- def assert_dom_equal(expected, actual)
11
- expected_dom = Nokogiri::HTML.fragment(expected).child
12
- actual_dom = Nokogiri::HTML.fragment(actual).child
12
+ def assert_dom_equal(expected, actual, opts = {})
13
+ expected_dom = Nokogiri::HTML.fragment(expected)
14
+ actual_dom = Nokogiri::HTML.fragment(actual)
15
+
16
+ assert(EquivalentXml.equivalent?(actual, expected, opts),
17
+ ['expected:', expected_dom.to_s,
18
+ 'actual:', actual_dom.to_s].join("\n"))
13
19
 
14
- assert_equal expected_dom, actual_dom
15
20
  end
16
21
 
17
22
  def assert_attr_equal(value, element, name)
@@ -1,7 +1,7 @@
1
1
  module Minitest
2
2
  module Extra
3
3
  module Matchers
4
- VERSION = '0.0.14'
4
+ VERSION = '0.0.15'
5
5
  end
6
6
  end
7
7
  end
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.require_paths = ["lib"]
21
21
 
22
22
  spec.add_dependency 'minitest', '>= 4.0'
23
- spec.add_dependency 'nokogiri', '>= 1.6'
23
+ spec.add_dependency 'equivalent-xml'
24
24
 
25
25
  spec.add_development_dependency "bundler", "~> 1.5"
26
26
  spec.add_development_dependency "rake"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-extra-matchers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Łukasz Niemier"
@@ -25,19 +25,19 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '4.0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: nokogiri
28
+ name: equivalent-xml
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '1.6'
33
+ version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '1.6'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement