minitest-extra-matchers 0.0.7 → 0.0.8

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: 506cd092fe38e70044634ee37955c55ab9363a99
4
- data.tar.gz: 4430b8ee1f6ee10e76633bfac49064bd1458e043
3
+ metadata.gz: 9b04aa5f8c703756cbd48c5968cfff5276bc425a
4
+ data.tar.gz: edaff6cc21ae1f34b2413d0d51794332d5368de1
5
5
  SHA512:
6
- metadata.gz: b70a957fef4183ac965da3d1487d5fb65c2709ee5ab551b4d3db178857a2d31d7f307c63a31e52c287c02cb40bbff5b0f3d64b442a80b7d9d35c43570c9a333a
7
- data.tar.gz: ca4e74c316273712645ecbcb0ad52c158eda6b537d27d33479095e3c7e922e6c6854594968e6eac5a1c44127a5c8c75f231eb9f899f81b53e78e946a43eeb652
6
+ metadata.gz: bf423e441181baccef5727c1fb9fecf2330270667b86cceb268cba80d5e5deec257db0001afac0dda20252c0f417b1b1568a3c4f62f725a3c483ee8d860939dc
7
+ data.tar.gz: e370cc564b97929871608d67a82c5d97f4974d4f26dd8a8c1d72efd30dfddffa8a6e88e0b187192a782520541a7e1ee9e5448c829c0e52a45006d487280c531c
@@ -5,15 +5,23 @@ module Minitest
5
5
  def self.included(base)
6
6
  base.class_eval do
7
7
  infect_an_assertion :assert_dom_equal, :must_equal_dom
8
+ infect_an_assertion :assert_attribute_equal, :must_have_attribute,
9
+ :dont_flip
8
10
  end
9
11
  end
10
12
 
11
13
  def assert_dom_equal(expected, actual)
12
- expected_dom = HTML::Document.new(expected).root
13
- actual_dom = HTML::Document.new(actual).root
14
+ expected_dom = Nokogiri::HTML(expected).root
15
+ actual_dom = Nokogiri::HTML(actual).root
14
16
 
15
17
  assert_equal expected_dom, actual_dom
16
18
  end
19
+
20
+ def assert_attribute_equal(element, name, value)
21
+ actual = HTML::Document.new(element).root.attribute(name)
22
+
23
+ assert_equal value, actual
24
+ end
17
25
  end
18
26
  end
19
27
  end
@@ -1,7 +1,7 @@
1
1
  module Minitest
2
2
  module Extra
3
3
  module Matchers
4
- VERSION = '0.0.7'
4
+ VERSION = '0.0.8'
5
5
  end
6
6
  end
7
7
  end
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.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Łukasz Niemier"