spec/html/proofer_spec.rb in html-proofer-1.5.4 vs spec/html/proofer_spec.rb in html-proofer-1.6.0

- old
+ new

@@ -73,7 +73,30 @@ * spec/html/proofer/fixtures/sorting/status/a_404.html: External link http://upload.wikimedia.org/wikipedia/en/thumb/not_here.png failed: 404 No error * spec/html/proofer/fixtures/sorting/status/broken_link.html: External link http://upload.wikimedia.org/wikipedia/en/thumb/fooooof.png failed: 404 No error """.strip) end end + + describe "file ignores" do + it "knows how to ignore a file by string" do + options = { :file_ignore => ["#{FIXTURES_DIR}/links/brokenHashInternal.html"] } + brokenHashInternalFilepath = "#{FIXTURES_DIR}/links/brokenHashInternal.html" + proofer = make_proofer(brokenHashInternalFilepath, options) + expect(proofer.failed_tests).to eq [] + end + + it "knows how to ignore a file by regexp" do + options = { :file_ignore => [/brokenHash/] } + brokenHashInternalFilepath = "#{FIXTURES_DIR}/links/brokenHashInternal.html" + proofer = make_proofer(brokenHashInternalFilepath, options) + expect(proofer.failed_tests).to eq [] + end + + it "knows how to ignore a directory by regexp" do + options = { :file_ignore => [/\S\.html/] } + linksDir = "#{FIXTURES_DIR}/links" + proofer = make_proofer(linksDir, options) + expect(proofer.failed_tests).to eq [] + end + end end end