approvals 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: 05e4a187eb113b076fa45cf703b6d18387566b4b
4
- data.tar.gz: f1fb16a23a52fd23e9977f38454d56fa39cbe259
3
+ metadata.gz: 3467c5674b942ca5ea76c264bc3b0773e2b99983
4
+ data.tar.gz: 60478c31b4f022bb605ffa3a4e9da511759e1002
5
5
  SHA512:
6
- metadata.gz: 0e21e4bc8fa547a3f9435c23d5fa2dd38ab287c78b401ba34b2d6db129cd8207a91493777eabfc12e7e793e7ce2ea89a5b8a80d2c0252f84306790b7f72652ce
7
- data.tar.gz: f74e954adff3805bfa78a28befd40c0cd9f9cf26ef9c48a28efde0dca7a1059660ba7ce4a4f853ba832d4347871d90e1bc2cf8fc9a7bc15624293cb78da29e36
6
+ metadata.gz: ff18968ce69e403214ff9eeb5698a63dfe958417f6d060e57b6e532dc541c6e034ea19640e7ab1cd17f8b1c4acc40c5dfec50252030b7ffaaf2bee57d87a5e28
7
+ data.tar.gz: 46e7be4063ba047353afb5dfceaaca6c1d7bce071fb5341c0c444a25411a7dc961be75d0271be2c60fb8c64b4ea319788e2fec3ab93fef401b46ab991301d85d
@@ -1,3 +1,3 @@
1
1
  module Approvals
2
- VERSION = '0.0.14'
2
+ VERSION = '0.0.15'
3
3
  end
@@ -7,7 +7,7 @@ module Approvals
7
7
  end
8
8
 
9
9
  def format(data)
10
- Nokogiri::XML(data.to_s.strip,&:noblanks).to_xhtml(:indent => 2, :encoding => 'UTF-8')
10
+ Nokogiri::HTML(data.to_s.strip,&:noblanks).to_xhtml(:indent => 2, :encoding => 'UTF-8')
11
11
  end
12
12
 
13
13
  end
@@ -57,6 +57,17 @@ describe Approvals do
57
57
  Approvals.verify html, :format => :html, :namer => namer
58
58
  end
59
59
 
60
+ it "verifies a malformed html fragment" do
61
+ html = <<-HTML
62
+ <!DOCTYPE html>
63
+ <html>
64
+ <title>Hoi</title>
65
+ <script async defer src="http://foo.com/bar.js"></script>
66
+ <h1>yo</h1>
67
+ HTML
68
+ Approvals.verify html, :format => :html, :namer => namer
69
+ end
70
+
60
71
  it "verifies xml" do
61
72
  xml = "<xml char=\"kiddo\"><node><content name='beatrice' /></node><node aliases='5'><content /></node></xml>"
62
73
  Approvals.verify xml, :format => :xml, :namer => namer
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE html>
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5
+ <title>Hoi</title>
6
+ <script async="" defer="defer" src="http://foo.com/bar.js"></script>
7
+ </head>
8
+ <body>
9
+ <h1>yo</h1>
10
+ </body>
11
+ </html>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: approvals
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
  - Katrina Owen
@@ -135,6 +135,7 @@ files:
135
135
  - spec/fixtures/approvals/approvals_supports_excluded_keys_option_verifies_json_with_excluded_keys.approved.json
136
136
  - spec/fixtures/approvals/approvals_verifies_a_complex_object.approved.txt
137
137
  - spec/fixtures/approvals/approvals_verifies_a_hash.approved.txt
138
+ - spec/fixtures/approvals/approvals_verifies_a_malformed_html_fragment.approved.html
138
139
  - spec/fixtures/approvals/approvals_verifies_a_string.approved.txt
139
140
  - spec/fixtures/approvals/approvals_verifies_an_array.approved.txt
140
141
  - spec/fixtures/approvals/approvals_verifies_an_array_as_json_when_format_is_set_to_json.approved.json