diff --git a/spec/html-proofer/command_spec.rb b/spec/html-proofer/command_spec.rb
index 9ae68263..1a6ecee6 100644
--- a/spec/html-proofer/command_spec.rb
+++ b/spec/html-proofer/command_spec.rb
@@ -7,8 +7,8 @@
end
it 'works with alt-ignore' do
- ignorableLinks = "#{FIXTURES_DIR}/images/ignorableAltViaOptions.html"
- output = make_bin('--alt-ignore /wikimedia/,gpl.png', ignorableLinks)
+ ignorable_links = "#{FIXTURES_DIR}/images/ignorable_alt_via_options.html"
+ output = make_bin('--alt-ignore /wikimedia/,gpl.png', ignorable_links)
expect(output).to match('successfully')
end
@@ -20,8 +20,8 @@
end
it 'works with check-external-hash' do
- brokenHashOnTheWeb = "#{FIXTURES_DIR}/links/brokenHashOnTheWeb.html"
- output = make_bin('--check-external-hash', brokenHashOnTheWeb)
+ broken_hash_on_the_web = "#{FIXTURES_DIR}/links/broken_hash_on_the_web.html"
+ output = make_bin('--check-external-hash', broken_hash_on_the_web)
expect(output).to match('1 failure')
end
@@ -51,32 +51,32 @@
end
it 'works with internal-domains' do
- translatedLink = "#{FIXTURES_DIR}/links/linkTranslatedInternalDomains.html"
- output = make_bin('--internal-domains www.example.com,example.com', translatedLink)
+ translated_link = "#{FIXTURES_DIR}/links/link_translated_internal_domains.html"
+ output = make_bin('--internal-domains www.example.com,example.com', translated_link)
expect(output).to match('successfully')
end
it 'works with url-ignore' do
- ignorableLinks = "#{FIXTURES_DIR}/links/ignorableLinksViaOptions.html"
- output = make_bin('--url-ignore /^http:\/\//,/sdadsad/,../whaadadt.html', ignorableLinks)
+ ignorable_links = "#{FIXTURES_DIR}/links/ignorable_links_via_options.html"
+ output = make_bin('--url-ignore /^http:\/\//,/sdadsad/,../whaadadt.html', ignorable_links)
expect(output).to match('successfully')
end
it 'works with url-swap' do
- translatedLink = "#{FIXTURES_DIR}/links/linkTranslatedViaHrefSwap.html"
- output = make_bin('--url-swap "\A/articles/([\w-]+):\1.html"', translatedLink)
+ translated_link = "#{FIXTURES_DIR}/links/link_translated_via_href_swap.html"
+ output = make_bin('--url-swap "\A/articles/([\w-]+):\1.html"', translated_link)
expect(output).to match('successfully')
end
it 'works with url-swap and colon' do
- translatedLink = "#{FIXTURES_DIR}/links/linkTranslatedViaHrefSwap2.html"
- output = make_bin('--url-swap "http\://www.example.com:"', translatedLink)
+ translated_link = "#{FIXTURES_DIR}/links/link_translated_via_href_swap2.html"
+ output = make_bin('--url-swap "http\://www.example.com:"', translated_link)
expect(output).to match('successfully')
end
it 'works with only-4xx' do
- brokenHashOnTheWeb = "#{FIXTURES_DIR}/links/brokenHashOnTheWeb.html"
- output = make_bin('--only-4xx', brokenHashOnTheWeb)
+ broken_hash_on_the_web = "#{FIXTURES_DIR}/links/broken_hash_on_the_web.html"
+ output = make_bin('--only-4xx', broken_hash_on_the_web)
expect(output).to match('successfully')
end
@@ -93,7 +93,7 @@
end
it 'works with empty-alt-ignore' do
- broken = "#{FIXTURES_DIR}/html/emptyImageAltText.html"
+ broken = "#{FIXTURES_DIR}/html/empty_image_alt_text.html"
output = make_bin('--empty-alt-ignore', broken)
expect(output).to match('successfully')
end
diff --git a/spec/html-proofer/favicon_spec.rb b/spec/html-proofer/favicon_spec.rb
index ba608c2c..20673ebc 100644
--- a/spec/html-proofer/favicon_spec.rb
+++ b/spec/html-proofer/favicon_spec.rb
@@ -32,8 +32,8 @@
end
it 'translates links via url_swap' do
- translatedLink = "#{FIXTURES_DIR}/favicon/favicon_broken.html"
- proofer = run_proofer(translatedLink, :file, check_favicon: true, url_swap: { /^asdadaskdalsdk.+/ => '../resources/gpl.png' })
+ translated_link = "#{FIXTURES_DIR}/favicon/favicon_broken.html"
+ proofer = run_proofer(translated_link, :file, check_favicon: true, url_swap: { /^asdadaskdalsdk.+/ => '../resources/gpl.png' })
expect(proofer.failed_tests).to eq []
end
diff --git a/spec/html-proofer/fixtures/images/ariaHidden.html b/spec/html-proofer/fixtures/images/aria_hidden.html
similarity index 100%
rename from spec/html-proofer/fixtures/images/ariaHidden.html
rename to spec/html-proofer/fixtures/images/aria_hidden.html
diff --git a/spec/html-proofer/fixtures/images/emptyImageAltText.html b/spec/html-proofer/fixtures/images/empty_image_alt_text.html
similarity index 100%
rename from spec/html-proofer/fixtures/images/emptyImageAltText.html
rename to spec/html-proofer/fixtures/images/empty_image_alt_text.html
diff --git a/spec/html-proofer/fixtures/images/existingImageExternal.html b/spec/html-proofer/fixtures/images/existing_image_external.html
similarity index 100%
rename from spec/html-proofer/fixtures/images/existingImageExternal.html
rename to spec/html-proofer/fixtures/images/existing_image_external.html
diff --git a/spec/html-proofer/fixtures/images/ignorableAltViaOptions.html b/spec/html-proofer/fixtures/images/ignorable_alt_via_options.html
similarity index 100%
rename from spec/html-proofer/fixtures/images/ignorableAltViaOptions.html
rename to spec/html-proofer/fixtures/images/ignorable_alt_via_options.html
diff --git a/spec/html-proofer/fixtures/images/ignoreAltButNotLink.html b/spec/html-proofer/fixtures/images/ignore_alt_but_not_link.html
similarity index 100%
rename from spec/html-proofer/fixtures/images/ignoreAltButNotLink.html
rename to spec/html-proofer/fixtures/images/ignore_alt_but_not_link.html
diff --git a/spec/html-proofer/fixtures/images/missingImageAlt.html b/spec/html-proofer/fixtures/images/missing_image_alt.html
similarity index 100%
rename from spec/html-proofer/fixtures/images/missingImageAlt.html
rename to spec/html-proofer/fixtures/images/missing_image_alt.html
diff --git a/spec/html-proofer/fixtures/images/missingImageAltText.html b/spec/html-proofer/fixtures/images/missing_image_alt_text.html
similarity index 100%
rename from spec/html-proofer/fixtures/images/missingImageAltText.html
rename to spec/html-proofer/fixtures/images/missing_image_alt_text.html
diff --git a/spec/html-proofer/fixtures/images/missingImageExternal.html b/spec/html-proofer/fixtures/images/missing_image_external.html
similarity index 100%
rename from spec/html-proofer/fixtures/images/missingImageExternal.html
rename to spec/html-proofer/fixtures/images/missing_image_external.html
diff --git a/spec/html-proofer/fixtures/images/missingImageInternal.html b/spec/html-proofer/fixtures/images/missing_image_internal.html
similarity index 100%
rename from spec/html-proofer/fixtures/images/missingImageInternal.html
rename to spec/html-proofer/fixtures/images/missing_image_internal.html
diff --git a/spec/html-proofer/fixtures/images/missingImageSrc.html b/spec/html-proofer/fixtures/images/missing_image_src.html
similarity index 100%
rename from spec/html-proofer/fixtures/images/missingImageSrc.html
rename to spec/html-proofer/fixtures/images/missing_image_src.html
diff --git a/spec/html-proofer/fixtures/images/relativeToSelf.html b/spec/html-proofer/fixtures/images/relative_to_self.html
similarity index 100%
rename from spec/html-proofer/fixtures/images/relativeToSelf.html
rename to spec/html-proofer/fixtures/images/relative_to_self.html
diff --git a/spec/html-proofer/fixtures/images/relativeWithBase.html.html b/spec/html-proofer/fixtures/images/relative_with_base.html.html
similarity index 100%
rename from spec/html-proofer/fixtures/images/relativeWithBase.html.html
rename to spec/html-proofer/fixtures/images/relative_with_base.html.html
diff --git a/spec/html-proofer/fixtures/images/replaceAbsUrlSrc.html b/spec/html-proofer/fixtures/images/replace_abs_url_src.html
similarity index 100%
rename from spec/html-proofer/fixtures/images/replaceAbsUrlSrc.html
rename to spec/html-proofer/fixtures/images/replace_abs_url_src.html
diff --git a/spec/html-proofer/fixtures/images/rootRelativeImages.html b/spec/html-proofer/fixtures/images/root_relative_images.html
similarity index 100%
rename from spec/html-proofer/fixtures/images/rootRelativeImages.html
rename to spec/html-proofer/fixtures/images/root_relative_images.html
diff --git a/spec/html-proofer/fixtures/images/srcSetCheck.html b/spec/html-proofer/fixtures/images/src_set_check.html
similarity index 100%
rename from spec/html-proofer/fixtures/images/srcSetCheck.html
rename to spec/html-proofer/fixtures/images/src_set_check.html
diff --git a/spec/html-proofer/fixtures/images/srcSetIgnorable.html b/spec/html-proofer/fixtures/images/src_set_ignorable.html
similarity index 100%
rename from spec/html-proofer/fixtures/images/srcSetIgnorable.html
rename to spec/html-proofer/fixtures/images/src_set_ignorable.html
diff --git a/spec/html-proofer/fixtures/images/srcSetMissingAlt.html b/spec/html-proofer/fixtures/images/src_set_missing_alt.html
similarity index 100%
rename from spec/html-proofer/fixtures/images/srcSetMissingAlt.html
rename to spec/html-proofer/fixtures/images/src_set_missing_alt.html
diff --git a/spec/html-proofer/fixtures/images/srcSetMissingImage.html b/spec/html-proofer/fixtures/images/src_set_missing_image.html
similarity index 100%
rename from spec/html-proofer/fixtures/images/srcSetMissingImage.html
rename to spec/html-proofer/fixtures/images/src_set_missing_image.html
diff --git a/spec/html-proofer/fixtures/images/terribleImageName.html b/spec/html-proofer/fixtures/images/terrible_image_name.html
similarity index 100%
rename from spec/html-proofer/fixtures/images/terribleImageName.html
rename to spec/html-proofer/fixtures/images/terrible_image_name.html
diff --git a/spec/html-proofer/fixtures/images/workingDataURIImage.html b/spec/html-proofer/fixtures/images/working_data_uri_image.html
similarity index 100%
rename from spec/html-proofer/fixtures/images/workingDataURIImage.html
rename to spec/html-proofer/fixtures/images/working_data_uri_image.html
diff --git a/spec/html-proofer/fixtures/links/brokenHashExternal.html b/spec/html-proofer/fixtures/links/broken_hash_external.html
similarity index 100%
rename from spec/html-proofer/fixtures/links/brokenHashExternal.html
rename to spec/html-proofer/fixtures/links/broken_hash_external.html
diff --git a/spec/html-proofer/fixtures/links/ignorableLinks.html b/spec/html-proofer/fixtures/links/ignorable_links.html
similarity index 100%
rename from spec/html-proofer/fixtures/links/ignorableLinks.html
rename to spec/html-proofer/fixtures/links/ignorable_links.html
diff --git a/spec/html-proofer/fixtures/links/ignorableLinksViaOptions.html b/spec/html-proofer/fixtures/links/ignorable_links_via_options.html
similarity index 100%
rename from spec/html-proofer/fixtures/links/ignorableLinksViaOptions.html
rename to spec/html-proofer/fixtures/links/ignorable_links_via_options.html
diff --git a/spec/html-proofer/html_spec.rb b/spec/html-proofer/html_spec.rb
index 45393717..0de8f41a 100644
--- a/spec/html-proofer/html_spec.rb
+++ b/spec/html-proofer/html_spec.rb
@@ -69,15 +69,15 @@
it 'ignores embeded scripts when asked' do
opts = { check_html: true, validation: { report_script_embeds: false } }
- ignorableScript = "#{FIXTURES_DIR}/html/ignore_script_embeds.html"
- proofer = run_proofer(ignorableScript, :file, opts)
+ ignorable_script = "#{FIXTURES_DIR}/html/ignore_script_embeds.html"
+ proofer = run_proofer(ignorable_script, :file, opts)
expect(proofer.failed_tests).to eq []
end
it 'reports embeded scripts when asked' do
opts = { check_html: true, validation: { report_script_embeds: true } }
- ignorableScript = "#{FIXTURES_DIR}/html/ignore_script_embeds.html"
- proofer = run_proofer(ignorableScript, :file, opts)
+ ignorable_script = "#{FIXTURES_DIR}/html/ignore_script_embeds.html"
+ proofer = run_proofer(ignorable_script, :file, opts)
expect(proofer.failed_tests.length).to eq 2
end
@@ -111,7 +111,7 @@
it 'ignores namespaces' do
opts = { check_html: true }
- ignorableNamespace = "#{FIXTURES_DIR}/html/ignore_namespace.html"
+ ignorable_namespace = "#{FIXTURES_DIR}/html/ignore_namespace.html"
proofer = run_proofer(ignorableNamespace, :file, opts)
expect(proofer.failed_tests).to eq []
end
diff --git a/spec/html-proofer/images_spec.rb b/spec/html-proofer/images_spec.rb
index 14ba89aa..5a5ac671 100644
--- a/spec/html-proofer/images_spec.rb
+++ b/spec/html-proofer/images_spec.rb
@@ -2,177 +2,177 @@
describe 'Images test' do
it 'passes for existing external images' do
- externalImageFilepath = "#{FIXTURES_DIR}/images/existingImageExternal.html"
- proofer = run_proofer(externalImageFilepath, :file)
+ external_image_filepath = "#{FIXTURES_DIR}/images/existing_image_external.html"
+ proofer = run_proofer(external_image_filepath, :file)
expect(proofer.failed_tests).to eq []
end
it 'fails for image without alt attribute' do
- missingAltFilepath = "#{FIXTURES_DIR}/images/missingImageAlt.html"
- proofer = run_proofer(missingAltFilepath, :file)
+ missing_alt_filepath = "#{FIXTURES_DIR}/images/missing_image_alt.html"
+ proofer = run_proofer(missing_alt_filepath, :file)
expect(proofer.failed_tests.first).to match(/gpl.png does not have an alt attribute/)
end
it 'fails for image with an empty alt attribute' do
- missingAltFilepath = "#{FIXTURES_DIR}/images/missingImageAltText.html"
- proofer = run_proofer(missingAltFilepath, :file)
+ missing_alt_filepath = "#{FIXTURES_DIR}/images/missing_image_alt_text.html"
+ proofer = run_proofer(missing_alt_filepath, :file)
expect(proofer.failed_tests.first).to match(/gpl.png does not have an alt attribute/)
end
it 'fails for image with nothing but spaces in alt attribute' do
- emptyAltFilepath = "#{FIXTURES_DIR}/images/emptyImageAltText.html"
- proofer = run_proofer(emptyAltFilepath, :file)
+ empty_alt_filepath = "#{FIXTURES_DIR}/images/empty_image_alt_text.html"
+ proofer = run_proofer(empty_alt_filepath, :file)
expect(proofer.failed_tests.first).to match(/gpl.png does not have an alt attribute/)
expect(proofer.failed_tests.length).to equal(3)
end
it 'passes when ignoring image with nothing but spaces in alt attribute' do
- emptyAltFilepath = "#{FIXTURES_DIR}/images/emptyImageAltText.html"
- proofer = run_proofer(emptyAltFilepath, :file, alt_ignore: [/.+/])
+ empty_alt_filepath = "#{FIXTURES_DIR}/images/empty_image_alt_text.html"
+ proofer = run_proofer(empty_alt_filepath, :file, alt_ignore: [/.+/])
expect(proofer.failed_tests).to eq []
end
it 'fails for missing external images' do
- externalImageFilepath = "#{FIXTURES_DIR}/images/missingImageExternal.html"
- proofer = run_proofer(externalImageFilepath, :file)
+ external_image_filepath = "#{FIXTURES_DIR}/images/missing_image_external.html"
+ proofer = run_proofer(external_image_filepath, :file)
expect(proofer.failed_tests.first).to match(/failed: response code 0/)
end
it 'fails for missing internal images even when alt_ignore is set' do
- internalImageFilepath = "#{FIXTURES_DIR}/images/missingImageInternal.html"
- proofer = run_proofer(internalImageFilepath, :file, alt_ignore: [/.*/])
+ internal_image_filepath = "#{FIXTURES_DIR}/images/missing_image_internal.html"
+ proofer = run_proofer(internal_image_filepath, :file, alt_ignore: [/.*/])
expect(proofer.failed_tests.first).to match(/doesnotexist.png does not exist/)
end
it 'fails for missing internal images' do
- internalImageFilepath = "#{FIXTURES_DIR}/images/missingImageInternal.html"
- proofer = run_proofer(internalImageFilepath, :file)
+ internal_image_filepath = "#{FIXTURES_DIR}/images/missing_image_internal.html"
+ proofer = run_proofer(internal_image_filepath, :file)
expect(proofer.failed_tests.first).to match(/doesnotexist.png does not exist/)
end
it 'fails for image with no src' do
- imageSrcFilepath = "#{FIXTURES_DIR}/images/missingImageSrc.html"
- proofer = run_proofer(imageSrcFilepath, :file)
+ image_src_filepath = "#{FIXTURES_DIR}/images/missing_image_src.html"
+ proofer = run_proofer(image_src_filepath, :file)
expect(proofer.failed_tests.first).to match(/image has no src or srcset attribute/)
end
it 'fails for image with default mac filename' do
- terribleImageName = "#{FIXTURES_DIR}/images/terribleImageName.html"
- proofer = run_proofer(terribleImageName, :file)
+ terrible_image_name = "#{FIXTURES_DIR}/images/terrible_image_name.html"
+ proofer = run_proofer(terrible_image_name, :file)
expect(proofer.failed_tests.first).to match(/image has a terrible filename/)
end
it 'ignores images marked as ignore data-proofer-ignore' do
- ignorableImages = "#{FIXTURES_DIR}/images/ignorableImages.html"
- proofer = run_proofer(ignorableImages, :file)
+ ignorable_images = "#{FIXTURES_DIR}/images/ignorable_images.html"
+ proofer = run_proofer(ignorable_images, :file)
expect(proofer.failed_tests).to eq []
end
it 'ignores images via url_ignore' do
- ignorableImage = "#{FIXTURES_DIR}/images/terribleImageName.html"
- proofer = run_proofer(ignorableImage, :file, url_ignore: [%r{./Screen.+}])
+ ignorable_image = "#{FIXTURES_DIR}/images/terrible_image_name.html"
+ proofer = run_proofer(ignorable_image, :file, url_ignore: [%r{./Screen.+}])
expect(proofer.failed_tests).to eq []
end
it 'translates images via url_swap' do
- translatedLink = "#{FIXTURES_DIR}/images/terribleImageName.html"
- proofer = run_proofer(translatedLink, :file, url_swap: { %r{./Screen.+} => 'gpl.png' })
+ translated_link = "#{FIXTURES_DIR}/images/terrible_image_name.html"
+ proofer = run_proofer(translated_link, :file, url_swap: { %r{./Screen.+} => 'gpl.png' })
expect(proofer.failed_tests).to eq []
end
it 'properly checks relative images' do
- relativeImages = "#{FIXTURES_DIR}/images/rootRelativeImages.html"
- proofer = run_proofer(relativeImages, :file)
+ relative_images = "#{FIXTURES_DIR}/images/root_relative_images.html"
+ proofer = run_proofer(relative_images, :file)
expect(proofer.failed_tests).to eq []
- relativeImages = "#{FIXTURES_DIR}/resources/books/nestedRelativeImages.html"
- proofer = run_proofer(relativeImages, :file)
+ relative_images = "#{FIXTURES_DIR}/resources/books/nested_relative_images.html"
+ proofer = run_proofer(relative_images, :file)
expect(proofer.failed_tests).to eq []
end
it 'properly ignores data URI images' do
- dataURIImage = "#{FIXTURES_DIR}/images/workingDataURIImage.html"
- proofer = run_proofer(dataURIImage, :file)
+ data_uri_image = "#{FIXTURES_DIR}/images/working_data_uri_image.html"
+ proofer = run_proofer(data_uri_image, :file)
expect(proofer.failed_tests).to eq []
end
it 'works for valid images missing the protocol' do
- missingProtocolLink = "#{FIXTURES_DIR}/images/image_missing_protocol_valid.html"
- proofer = run_proofer(missingProtocolLink, :file)
+ missing_protocol_link = "#{FIXTURES_DIR}/images/image_missing_protocol_valid.html"
+ proofer = run_proofer(missing_protocol_link, :file)
expect(proofer.failed_tests).to eq []
end
it 'fails for invalid images missing the protocol' do
- missingProtocolLink = "#{FIXTURES_DIR}/images/image_missing_protocol_invalid.html"
- proofer = run_proofer(missingProtocolLink, :file)
+ missing_protocol_link = "#{FIXTURES_DIR}/images/image_missing_protocol_invalid.html"
+ proofer = run_proofer(missing_protocol_link, :file)
expect(proofer.failed_tests.first).to match(/failed: 404/)
end
it 'properly checks relative links' do
- relativeLinks = "#{FIXTURES_DIR}/images/relativeToSelf.html"
- proofer = run_proofer(relativeLinks, :file)
+ relative_links = "#{FIXTURES_DIR}/images/relative_to_self.html"
+ proofer = run_proofer(relative_links, :file)
expect(proofer.failed_tests).to eq []
end
it 'properly ignores missing alt tags when asked' do
- ignorableLinks = "#{FIXTURES_DIR}/images/ignorableAltViaOptions.html"
- proofer = run_proofer(ignorableLinks, :file, alt_ignore: [/wikimedia/, 'gpl.png'])
+ ignoreable_links = "#{FIXTURES_DIR}/images/ignorable_alt_via_options.html"
+ proofer = run_proofer(ignoreable_links, :file, alt_ignore: [/wikimedia/, 'gpl.png'])
expect(proofer.failed_tests).to eq []
end
it 'properly ignores missing alt tags, but not all URLs, when asked' do
- ignorableLinks = "#{FIXTURES_DIR}/images/ignoreAltButNotLink.html"
- proofer = run_proofer(ignorableLinks, :file, alt_ignore: [/.*/])
+ ignoreable_links = "#{FIXTURES_DIR}/images/ignore_alt_but_not_link.html"
+ proofer = run_proofer(ignoreable_links, :file, alt_ignore: [/.*/])
expect(proofer.failed_tests.first).to match(/failed: response code 0/)
expect(proofer.failed_tests.first).to_not match /does not have an alt attribute/
end
it 'properly ignores empty alt attribute when empty_alt_ignore set' do
- missingAltFilepath = "#{FIXTURES_DIR}/images/emptyImageAltText.html"
- proofer = run_proofer(missingAltFilepath, :file, empty_alt_ignore: true)
+ missing_alt_filepath = "#{FIXTURES_DIR}/images/empty_image_alt_text.html"
+ proofer = run_proofer(missing_alt_filepath, :file, empty_alt_ignore: true)
expect(proofer.failed_tests).to eq []
end
it 'properly ignores empty alt attributes, but not missing alt attributes, when empty_alt_ignore set' do
- missingAltFilepath = "#{FIXTURES_DIR}/images/missingImageAlt.html"
- proofer = run_proofer(missingAltFilepath, :file, empty_alt_ignore: true)
+ missing_alt_filepath = "#{FIXTURES_DIR}/images/missing_image_alt.html"
+ proofer = run_proofer(missing_alt_filepath, :file, empty_alt_ignore: true)
expect(proofer.failed_tests.first).to match(/gpl.png does not have an alt attribute/)
end
it 'works for images with a srcset' do
- srcSetCheck = "#{FIXTURES_DIR}/images/srcSetCheck.html"
- proofer = run_proofer(srcSetCheck, :file)
+ src_set_check = "#{FIXTURES_DIR}/images/src_set_check.html"
+ proofer = run_proofer(src_set_check, :file)
expect(proofer.failed_tests).to eq []
end
it 'skips missing alt tag for images marked as aria-hidden' do
- srcSetCheck = "#{FIXTURES_DIR}/images/ariaHidden.html"
- proofer = run_proofer(srcSetCheck, :file)
+ src_set_check = "#{FIXTURES_DIR}/images/aria_hidden.html"
+ proofer = run_proofer(src_set_check, :file)
expect(proofer.failed_tests.size).to eq 1
expect(proofer.failed_tests.first).to match(/image .\/gpl.png does not have an alt attribute/)
end
it 'fails for images with a srcset but missing alt' do
- srcSetMissingAlt = "#{FIXTURES_DIR}/images/srcSetMissingAlt.html"
- proofer = run_proofer(srcSetMissingAlt, :file)
+ src_set_missing_alt = "#{FIXTURES_DIR}/images/src_set_missing_alt.html"
+ proofer = run_proofer(src_set_missing_alt, :file)
expect(proofer.failed_tests.first).to match(/image gpl.png does not have an alt attribute/)
end
it 'fails for images with an alt but missing src or srcset' do
- srcSetMissingAlt = "#{FIXTURES_DIR}/images/srcSetMissingImage.html"
- proofer = run_proofer(srcSetMissingAlt, :file)
+ src_set_missing_alt = "#{FIXTURES_DIR}/images/src_set_missing_image.html"
+ proofer = run_proofer(src_set_missing_alt, :file)
expect(proofer.failed_tests.first).to match(/internal image notreal.png does not exist/)
end
it 'properly ignores missing alt tags when asked for srcset' do
- ignorableLinks = "#{FIXTURES_DIR}/images/srcSetIgnorable.html"
- proofer = run_proofer(ignorableLinks, :file, alt_ignore: [/wikimedia/, 'gpl.png'])
+ ignoreable_links = "#{FIXTURES_DIR}/images/src_set_ignorable.html"
+ proofer = run_proofer(ignoreable_links, :file, alt_ignore: [/wikimedia/, 'gpl.png'])
expect(proofer.failed_tests).to eq []
end
it 'translates src via href_swap' do
- translatedSrc = "#{FIXTURES_DIR}/images/replaceAbsUrlSrc.html"
- proofer = run_proofer(translatedSrc, :file, href_swap: { %r{^http://example.com} => '' })
+ translate_src = "#{FIXTURES_DIR}/images/replace_abs_url_src.html"
+ proofer = run_proofer(translate_src, :file, href_swap: { %r{^http://example.com} => '' })
expect(proofer.failed_tests).to eq []
end
@@ -189,8 +189,8 @@
end
it 'properly checks relative images with base' do
- relativeImages = "#{FIXTURES_DIR}/images/relativeWithBase.html"
- proofer = run_proofer(relativeImages, :file)
+ relative_images = "#{FIXTURES_DIR}/images/relative_with_base.html"
+ proofer = run_proofer(relative_images, :file)
expect(proofer.failed_tests).to eq []
end
end