html-proofer 0.7.3 → 0.8.0

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: a0a7e012ed8c1b0d6cdeef435ae79dd58baa0a27
4
- data.tar.gz: 127fd94d704f7f8e025ad7e11fc6e160760ca4b3
3
+ metadata.gz: 58e3804b2c58cfc45bef2a6de1a8a2e97ccd6132
4
+ data.tar.gz: f0cff86b5f52382e228090a6aa5992815ea3d9de
5
5
  SHA512:
6
- metadata.gz: bd69fa95dbaa2c710eac509f32b6b0266edec7791b25b9f4e59f486038483cce2f3320729ff145e52fdddcef22b705abc640bdc6de6255739c4b6a2e655699f8
7
- data.tar.gz: 08df5c237f85327b776476ab3e03534f58267f10c84a92d6741e872286d242ae43811ef07651759be29627e93a32c408dfb3ae9ae678974ac1549b2f993dc420
6
+ metadata.gz: cc7bc7d35c99e356ea94c69472957f923f117f18ac119c8ce147794ad6ba6cc9dab9369ef244c8cb9498a92e9a823e14f77e88a89d564a701af66dbc65d2d7ca
7
+ data.tar.gz: be3629b356a39521baa248e6e4a705ba625d9bca4dc697ba5dfdab7344228dbe2c4a104293a73019387eb0ab4593e8d1af96c95272c54393a2b285bc5b7d69dc
data/.travis.yml CHANGED
@@ -1,4 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
- - 2.0.0
4
+ - 2.0.0
5
+ before_install:
6
+ - export NOKOGIRI_USE_SYSTEM_LIBRARIES=true
data/README.md CHANGED
@@ -92,9 +92,18 @@ htmlproof ./_site
92
92
 
93
93
  ## What's Tested?
94
94
 
95
+ ### Images
96
+
97
+ `img` elements:
98
+
95
99
  * Whether all your images have alt tags
96
100
  * Whether your internal image references are not broken
97
101
  * Whether external images are showing
102
+
103
+ ### Links
104
+
105
+ `a`, `link` elements:
106
+
98
107
  * Whether your internal links are not broken; this includes hash references (`#linkToMe`)
99
108
  * Whether external links are working
100
109
 
data/html-proofer.gemspec CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |gem|
5
5
  gem.name = "html-proofer"
6
- gem.version = "0.7.3"
6
+ gem.version = "0.8.0"
7
7
  gem.authors = ["Garen Torikian"]
8
8
  gem.email = ["gjtorikian@gmail.com"]
9
9
  gem.description = %q{Test your rendered HTML files to make sure they're accurate.}
@@ -15,7 +15,7 @@ end
15
15
  class Links < ::HTML::Proofer::Checks::Check
16
16
 
17
17
  def run
18
- @html.css('a').each do |l|
18
+ @html.css('a, link').each do |l|
19
19
  link = Link.new l, "link", self
20
20
 
21
21
  # is it even a valid URL?
@@ -0,0 +1,7 @@
1
+ <html>
2
+ <head>
3
+ <link rel="icon" href="gpl.png">
4
+ </head>
5
+ <body>
6
+ </body>
7
+ </html>
@@ -0,0 +1,7 @@
1
+ <html>
2
+ <head>
3
+ <link rel="icon">
4
+ </head>
5
+ <body>
6
+ </body>
7
+ </html>
@@ -0,0 +1,7 @@
1
+ <html>
2
+ <head>
3
+ <link rel="icon" href="">
4
+ </head>
5
+ <body>
6
+ </body>
7
+ </html>
@@ -133,4 +133,22 @@ describe "Links tests" do
133
133
  output = capture_stderr { HTML::Proofer.new(missingProtocolLink).run }
134
134
  output.should match /Couldn't resolve host name/
135
135
  end
136
+
137
+ it "works for valid href within link elements" do
138
+ head_link = "#{FIXTURES_DIR}/head_link_href.html"
139
+ output = capture_stderr { HTML::Proofer.new(head_link).run }
140
+ output.should == ""
141
+ end
142
+
143
+ it "fails for empty href within link elements" do
144
+ head_link = "#{FIXTURES_DIR}/head_link_href_empty.html"
145
+ output = capture_stderr { HTML::Proofer.new(head_link).run }
146
+ output.should match /link has no href attribute/
147
+ end
148
+
149
+ it "fails for absent href within link elements" do
150
+ head_link = "#{FIXTURES_DIR}/head_link_href_absent.html"
151
+ output = capture_stderr { HTML::Proofer.new(head_link).run }
152
+ output.should match /link has no href attribute/
153
+ end
136
154
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html-proofer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.3
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-09 00:00:00.000000000 Z
11
+ date: 2014-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mercenary
@@ -174,6 +174,9 @@ files:
174
174
  - spec/html/proofer/fixtures/folder/index.html
175
175
  - spec/html/proofer/fixtures/folder/relativeImage.html
176
176
  - spec/html/proofer/fixtures/gpl.png
177
+ - spec/html/proofer/fixtures/head_link_href.html
178
+ - spec/html/proofer/fixtures/head_link_href_absent.html
179
+ - spec/html/proofer/fixtures/head_link_href_empty.html
177
180
  - spec/html/proofer/fixtures/ignorableImages.html
178
181
  - spec/html/proofer/fixtures/ignorableLinks.html
179
182
  - spec/html/proofer/fixtures/ignorableLinksViaOptions.html
@@ -252,6 +255,9 @@ test_files:
252
255
  - spec/html/proofer/fixtures/folder/index.html
253
256
  - spec/html/proofer/fixtures/folder/relativeImage.html
254
257
  - spec/html/proofer/fixtures/gpl.png
258
+ - spec/html/proofer/fixtures/head_link_href.html
259
+ - spec/html/proofer/fixtures/head_link_href_absent.html
260
+ - spec/html/proofer/fixtures/head_link_href_empty.html
255
261
  - spec/html/proofer/fixtures/ignorableImages.html
256
262
  - spec/html/proofer/fixtures/ignorableLinks.html
257
263
  - spec/html/proofer/fixtures/ignorableLinksViaOptions.html