html-proofer 1.1.4 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/lib/html/proofer/checks/links.rb +1 -1
  3. metadata +5 -168
  4. data/.gitignore +0 -26
  5. data/.travis.yml +0 -6
  6. data/Gemfile +0 -3
  7. data/LICENSE.txt +0 -22
  8. data/README.md +0 -177
  9. data/Rakefile +0 -8
  10. data/html-proofer.gemspec +0 -28
  11. data/spec/html/proofer/favicon_spec.rb +0 -46
  12. data/spec/html/proofer/fixtures/favicon/favicon_absent.html +0 -4
  13. data/spec/html/proofer/fixtures/favicon/favicon_absent_apple.html +0 -7
  14. data/spec/html/proofer/fixtures/favicon/favicon_broken.html +0 -7
  15. data/spec/html/proofer/fixtures/favicon/favicon_broken_but_ignored.html +0 -7
  16. data/spec/html/proofer/fixtures/favicon/favicon_present.html +0 -7
  17. data/spec/html/proofer/fixtures/favicon/favicon_present_shortcut.html +0 -7
  18. data/spec/html/proofer/fixtures/images/existingImageExternal.html +0 -9
  19. data/spec/html/proofer/fixtures/images/gpl.png +0 -0
  20. data/spec/html/proofer/fixtures/images/ignorableAltViaOptions.html +0 -13
  21. data/spec/html/proofer/fixtures/images/ignorableImages.html +0 -10
  22. data/spec/html/proofer/fixtures/images/ignoreAltButNotLink.html +0 -13
  23. data/spec/html/proofer/fixtures/images/image_missing_protocol_invalid.html +0 -9
  24. data/spec/html/proofer/fixtures/images/image_missing_protocol_valid.html +0 -9
  25. data/spec/html/proofer/fixtures/images/missingImageAlt.html +0 -9
  26. data/spec/html/proofer/fixtures/images/missingImageAltText.html +0 -9
  27. data/spec/html/proofer/fixtures/images/missingImageExternal.html +0 -9
  28. data/spec/html/proofer/fixtures/images/missingImageInternal.html +0 -9
  29. data/spec/html/proofer/fixtures/images/missingImageSrc.html +0 -9
  30. data/spec/html/proofer/fixtures/images/relativeToSelf.html +0 -2
  31. data/spec/html/proofer/fixtures/images/rootRelativeImages.html +0 -2
  32. data/spec/html/proofer/fixtures/images/terribleImageName.html +0 -9
  33. data/spec/html/proofer/fixtures/images/workingDataURIImage.html +0 -3
  34. data/spec/html/proofer/fixtures/links/anchors_in_pre.html +0 -12
  35. data/spec/html/proofer/fixtures/links/blank_mailto_link.html +0 -9
  36. data/spec/html/proofer/fixtures/links/blank_tel_link.html +0 -9
  37. data/spec/html/proofer/fixtures/links/brokenHashExternal.html +0 -11
  38. data/spec/html/proofer/fixtures/links/brokenHashInternal.html +0 -14
  39. data/spec/html/proofer/fixtures/links/brokenInternalLink.html +0 -0
  40. data/spec/html/proofer/fixtures/links/brokenLinkExternal.html +0 -11
  41. data/spec/html/proofer/fixtures/links/brokenLinkInternal.html +0 -10
  42. data/spec/html/proofer/fixtures/links/brokenLinkWithNumber.html +0 -8
  43. data/spec/html/proofer/fixtures/links/checkSSLLinks.html +0 -1
  44. data/spec/html/proofer/fixtures/links/folder/anchorLink.html +0 -0
  45. data/spec/html/proofer/fixtures/links/folder/assets/barrel.png +0 -0
  46. data/spec/html/proofer/fixtures/links/folder/index.html +0 -0
  47. data/spec/html/proofer/fixtures/links/folder/relativeImage.html +0 -2
  48. data/spec/html/proofer/fixtures/links/gpl.png +0 -0
  49. data/spec/html/proofer/fixtures/links/head_link_href.html +0 -7
  50. data/spec/html/proofer/fixtures/links/head_link_href_absent.html +0 -7
  51. data/spec/html/proofer/fixtures/links/head_link_href_empty.html +0 -7
  52. data/spec/html/proofer/fixtures/links/ignorableLinks.html +0 -13
  53. data/spec/html/proofer/fixtures/links/ignorableLinksViaOptions.html +0 -13
  54. data/spec/html/proofer/fixtures/links/index.html +0 -1
  55. data/spec/html/proofer/fixtures/links/javascript_link.html +0 -9
  56. data/spec/html/proofer/fixtures/links/linkToFolder.html +0 -9
  57. data/spec/html/proofer/fixtures/links/linkTranslatedViaHrefSwap.html +0 -9
  58. data/spec/html/proofer/fixtures/links/linkWithHttps.html +0 -9
  59. data/spec/html/proofer/fixtures/links/linkWithRedirect.html +0 -12
  60. data/spec/html/proofer/fixtures/links/link_directory_without_slash.html +0 -1
  61. data/spec/html/proofer/fixtures/links/link_missing_protocol_invalid.html +0 -9
  62. data/spec/html/proofer/fixtures/links/link_missing_protocol_valid.html +0 -9
  63. data/spec/html/proofer/fixtures/links/links_in_pre.html +0 -13
  64. data/spec/html/proofer/fixtures/links/mailto_link.html +0 -9
  65. data/spec/html/proofer/fixtures/links/missingLinkHref.html +0 -9
  66. data/spec/html/proofer/fixtures/links/multipleProblems.html +0 -11
  67. data/spec/html/proofer/fixtures/links/notarealhash.html +0 -0
  68. data/spec/html/proofer/fixtures/links/relativeLinks.html +0 -4
  69. data/spec/html/proofer/fixtures/links/rootLink.html +0 -10
  70. data/spec/html/proofer/fixtures/links/tel_link.html +0 -9
  71. data/spec/html/proofer/fixtures/resources/Screen Shot 2012-08-09 at 7.51.18 AM.png +0 -0
  72. data/spec/html/proofer/fixtures/resources/books/assets/getting-good-with-git.jpg +0 -0
  73. data/spec/html/proofer/fixtures/resources/books/assets/pro-git.jpg +0 -0
  74. data/spec/html/proofer/fixtures/resources/books/assets/version-control-with-git.jpg +0 -0
  75. data/spec/html/proofer/fixtures/resources/books/nestedRelativeImages.html +0 -5
  76. data/spec/html/proofer/fixtures/resources/gpl.png +0 -0
  77. data/spec/html/proofer/fixtures/scripts/script.js +0 -1
  78. data/spec/html/proofer/fixtures/scripts/script_broken_external.html +0 -9
  79. data/spec/html/proofer/fixtures/scripts/script_content.html +0 -9
  80. data/spec/html/proofer/fixtures/scripts/script_content_absent.html +0 -9
  81. data/spec/html/proofer/fixtures/scripts/script_in_pre.html +0 -5
  82. data/spec/html/proofer/fixtures/scripts/script_missing_internal.html +0 -9
  83. data/spec/html/proofer/fixtures/scripts/script_valid_internal.html +0 -9
  84. data/spec/html/proofer/images_spec.rb +0 -98
  85. data/spec/html/proofer/links_spec.rb +0 -192
  86. data/spec/html/proofer/scripts_spec.rb +0 -41
  87. data/spec/html/proofer_spec.rb +0 -12
  88. 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
@@ -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