html-proofer 1.1.4 → 1.1.5
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 +4 -4
- data/lib/html/proofer/checks/links.rb +1 -1
- metadata +5 -168
- data/.gitignore +0 -26
- data/.travis.yml +0 -6
- data/Gemfile +0 -3
- data/LICENSE.txt +0 -22
- data/README.md +0 -177
- data/Rakefile +0 -8
- data/html-proofer.gemspec +0 -28
- data/spec/html/proofer/favicon_spec.rb +0 -46
- data/spec/html/proofer/fixtures/favicon/favicon_absent.html +0 -4
- data/spec/html/proofer/fixtures/favicon/favicon_absent_apple.html +0 -7
- data/spec/html/proofer/fixtures/favicon/favicon_broken.html +0 -7
- data/spec/html/proofer/fixtures/favicon/favicon_broken_but_ignored.html +0 -7
- data/spec/html/proofer/fixtures/favicon/favicon_present.html +0 -7
- data/spec/html/proofer/fixtures/favicon/favicon_present_shortcut.html +0 -7
- data/spec/html/proofer/fixtures/images/existingImageExternal.html +0 -9
- data/spec/html/proofer/fixtures/images/gpl.png +0 -0
- data/spec/html/proofer/fixtures/images/ignorableAltViaOptions.html +0 -13
- data/spec/html/proofer/fixtures/images/ignorableImages.html +0 -10
- data/spec/html/proofer/fixtures/images/ignoreAltButNotLink.html +0 -13
- data/spec/html/proofer/fixtures/images/image_missing_protocol_invalid.html +0 -9
- data/spec/html/proofer/fixtures/images/image_missing_protocol_valid.html +0 -9
- data/spec/html/proofer/fixtures/images/missingImageAlt.html +0 -9
- data/spec/html/proofer/fixtures/images/missingImageAltText.html +0 -9
- data/spec/html/proofer/fixtures/images/missingImageExternal.html +0 -9
- data/spec/html/proofer/fixtures/images/missingImageInternal.html +0 -9
- data/spec/html/proofer/fixtures/images/missingImageSrc.html +0 -9
- data/spec/html/proofer/fixtures/images/relativeToSelf.html +0 -2
- data/spec/html/proofer/fixtures/images/rootRelativeImages.html +0 -2
- data/spec/html/proofer/fixtures/images/terribleImageName.html +0 -9
- data/spec/html/proofer/fixtures/images/workingDataURIImage.html +0 -3
- data/spec/html/proofer/fixtures/links/anchors_in_pre.html +0 -12
- data/spec/html/proofer/fixtures/links/blank_mailto_link.html +0 -9
- data/spec/html/proofer/fixtures/links/blank_tel_link.html +0 -9
- data/spec/html/proofer/fixtures/links/brokenHashExternal.html +0 -11
- data/spec/html/proofer/fixtures/links/brokenHashInternal.html +0 -14
- data/spec/html/proofer/fixtures/links/brokenInternalLink.html +0 -0
- data/spec/html/proofer/fixtures/links/brokenLinkExternal.html +0 -11
- data/spec/html/proofer/fixtures/links/brokenLinkInternal.html +0 -10
- data/spec/html/proofer/fixtures/links/brokenLinkWithNumber.html +0 -8
- data/spec/html/proofer/fixtures/links/checkSSLLinks.html +0 -1
- data/spec/html/proofer/fixtures/links/folder/anchorLink.html +0 -0
- data/spec/html/proofer/fixtures/links/folder/assets/barrel.png +0 -0
- data/spec/html/proofer/fixtures/links/folder/index.html +0 -0
- data/spec/html/proofer/fixtures/links/folder/relativeImage.html +0 -2
- data/spec/html/proofer/fixtures/links/gpl.png +0 -0
- data/spec/html/proofer/fixtures/links/head_link_href.html +0 -7
- data/spec/html/proofer/fixtures/links/head_link_href_absent.html +0 -7
- data/spec/html/proofer/fixtures/links/head_link_href_empty.html +0 -7
- data/spec/html/proofer/fixtures/links/ignorableLinks.html +0 -13
- data/spec/html/proofer/fixtures/links/ignorableLinksViaOptions.html +0 -13
- data/spec/html/proofer/fixtures/links/index.html +0 -1
- data/spec/html/proofer/fixtures/links/javascript_link.html +0 -9
- data/spec/html/proofer/fixtures/links/linkToFolder.html +0 -9
- data/spec/html/proofer/fixtures/links/linkTranslatedViaHrefSwap.html +0 -9
- data/spec/html/proofer/fixtures/links/linkWithHttps.html +0 -9
- data/spec/html/proofer/fixtures/links/linkWithRedirect.html +0 -12
- data/spec/html/proofer/fixtures/links/link_directory_without_slash.html +0 -1
- data/spec/html/proofer/fixtures/links/link_missing_protocol_invalid.html +0 -9
- data/spec/html/proofer/fixtures/links/link_missing_protocol_valid.html +0 -9
- data/spec/html/proofer/fixtures/links/links_in_pre.html +0 -13
- data/spec/html/proofer/fixtures/links/mailto_link.html +0 -9
- data/spec/html/proofer/fixtures/links/missingLinkHref.html +0 -9
- data/spec/html/proofer/fixtures/links/multipleProblems.html +0 -11
- data/spec/html/proofer/fixtures/links/notarealhash.html +0 -0
- data/spec/html/proofer/fixtures/links/relativeLinks.html +0 -4
- data/spec/html/proofer/fixtures/links/rootLink.html +0 -10
- data/spec/html/proofer/fixtures/links/tel_link.html +0 -9
- data/spec/html/proofer/fixtures/resources/Screen Shot 2012-08-09 at 7.51.18 AM.png +0 -0
- data/spec/html/proofer/fixtures/resources/books/assets/getting-good-with-git.jpg +0 -0
- data/spec/html/proofer/fixtures/resources/books/assets/pro-git.jpg +0 -0
- data/spec/html/proofer/fixtures/resources/books/assets/version-control-with-git.jpg +0 -0
- data/spec/html/proofer/fixtures/resources/books/nestedRelativeImages.html +0 -5
- data/spec/html/proofer/fixtures/resources/gpl.png +0 -0
- data/spec/html/proofer/fixtures/scripts/script.js +0 -1
- data/spec/html/proofer/fixtures/scripts/script_broken_external.html +0 -9
- data/spec/html/proofer/fixtures/scripts/script_content.html +0 -9
- data/spec/html/proofer/fixtures/scripts/script_content_absent.html +0 -9
- data/spec/html/proofer/fixtures/scripts/script_in_pre.html +0 -5
- data/spec/html/proofer/fixtures/scripts/script_missing_internal.html +0 -9
- data/spec/html/proofer/fixtures/scripts/script_valid_internal.html +0 -9
- data/spec/html/proofer/images_spec.rb +0 -98
- data/spec/html/proofer/links_spec.rb +0 -192
- data/spec/html/proofer/scripts_spec.rb +0 -41
- data/spec/html/proofer_spec.rb +0 -12
- data/spec/spec_helper.rb +0 -30
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
require "spec_helper"
|
|
2
|
-
|
|
3
|
-
describe "Scripts test" do
|
|
4
|
-
|
|
5
|
-
it "fails for broken external src" do
|
|
6
|
-
file = "#{FIXTURES_DIR}/scripts/script_broken_external.html"
|
|
7
|
-
output = capture_stderr { HTML::Proofer.new(file).run }
|
|
8
|
-
output.should match /External link http:\/\/www.asdo3IRJ395295jsingrkrg4.com\/asdo3IRJ.js? failed: 0 Couldn't resolve host name/
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
it "works for valid internal src" do
|
|
12
|
-
file = "#{FIXTURES_DIR}/scripts/script_valid_internal.html"
|
|
13
|
-
output = capture_stderr { HTML::Proofer.new(file).run }
|
|
14
|
-
output.should == ""
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
it "fails for missing internal src" do
|
|
18
|
-
file = "#{FIXTURES_DIR}/scripts/script_missing_internal.html"
|
|
19
|
-
output = capture_stderr { HTML::Proofer.new(file).run }
|
|
20
|
-
output.should match /doesnotexist.js does not exist/
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
it "works for present content" do
|
|
24
|
-
file = "#{FIXTURES_DIR}/scripts/script_content.html"
|
|
25
|
-
output = capture_stderr { HTML::Proofer.new(file).run }
|
|
26
|
-
output.should == ""
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it "fails for absent content" do
|
|
30
|
-
file = "#{FIXTURES_DIR}/scripts/script_content_absent.html"
|
|
31
|
-
output = capture_stderr { HTML::Proofer.new(file).run }
|
|
32
|
-
output.should match /script is empty and has no src attribute/
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
it "works for broken script within pre" do
|
|
36
|
-
script_pre = "#{FIXTURES_DIR}/scripts/script_in_pre.html"
|
|
37
|
-
output = capture_stderr { HTML::Proofer.new(script_pre).run }
|
|
38
|
-
output.should == ""
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
end
|
data/spec/html/proofer_spec.rb
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
require "spec_helper"
|
|
2
|
-
|
|
3
|
-
describe HTML::Proofer do
|
|
4
|
-
describe "#failed_tests" do
|
|
5
|
-
it "is a list of the formatted errors" do
|
|
6
|
-
brokenLinkInternalFilepath = "#{FIXTURES_DIR}/links/brokenLinkInternal.html"
|
|
7
|
-
proofer = HTML::Proofer.new(brokenLinkInternalFilepath)
|
|
8
|
-
capture_stderr { proofer.run }
|
|
9
|
-
proofer.failed_tests.should eq(["\e[34mspec/html/proofer/fixtures/links/brokenLinkInternal.html\e[0m: internally linking to ./notreal.html, which does not exist", "\e[34mspec/html/proofer/fixtures/links/brokenLinkInternal.html\e[0m: internally linking to ./missingImageAlt.html, which does not exist"])
|
|
10
|
-
end
|
|
11
|
-
end
|
|
12
|
-
end
|
data/spec/spec_helper.rb
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
require 'bundler/setup'
|
|
2
|
-
require_relative "../lib/html/proofer"
|
|
3
|
-
|
|
4
|
-
FIXTURES_DIR = "spec/html/proofer/fixtures"
|
|
5
|
-
|
|
6
|
-
RSpec.configure do |config|
|
|
7
|
-
# Use color in STDOUT
|
|
8
|
-
config.color_enabled = true
|
|
9
|
-
|
|
10
|
-
# Use color not only in STDOUT but also in pagers and files
|
|
11
|
-
config.tty = true
|
|
12
|
-
|
|
13
|
-
# Use the specified formatter
|
|
14
|
-
config.formatter = :documentation # :progress, :html, :textmate
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def capture_stderr(&block)
|
|
18
|
-
original_stderr = $stderr
|
|
19
|
-
original_stdout = $stdout
|
|
20
|
-
$stderr = fake_err = StringIO.new
|
|
21
|
-
$stdout = fake_out = StringIO.new
|
|
22
|
-
begin
|
|
23
|
-
yield
|
|
24
|
-
rescue RuntimeError
|
|
25
|
-
ensure
|
|
26
|
-
$stderr = original_stderr
|
|
27
|
-
$stdout = original_stdout
|
|
28
|
-
end
|
|
29
|
-
fake_err.string
|
|
30
|
-
end
|