diff --git a/spec/accessibility_spec.rb b/spec/accessibility_spec.rb index b24f0f2..67e6986 100644 --- a/spec/accessibility_spec.rb +++ b/spec/accessibility_spec.rb @@ -36,14 +36,14 @@ visit(path) end - it "meets WCAG 2.1" do + it 'meets WCAG 2.1' do expect(page).to be_axe_clean .according_to(*required_a11y_standards) .skipping(*skipped_rules) .excluding(*excluded_elements) end - it "meets WCAG 2.2" do + it 'meets WCAG 2.2' do expect(page).to be_axe_clean .according_to(*complete_a11y_standards) .skipping(*skipped_rules) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a43a151..4ca3c4f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -30,7 +30,7 @@ require 'axe-rspec' require 'axe-capybara' -require_relative './support/jekyll' +require_relative 'support/jekyll' # Used to set the path for a local webserver. # Update this if you move this file. @@ -57,7 +57,7 @@ end Capybara::Screenshot.register_filename_prefix_formatter(:rspec) do |example| - path = example.example_group.top_level_description.gsub(/^\//, '').gsub('/', '-').gsub(' is accessible', '') + path = example.example_group.top_level_description.gsub(%r{^/}, '').gsub('/', '-').gsub(' is accessible', '') standards = example.description.split(' ').last "tmp/capybara/screenshot_#{page}_#{standards}" end diff --git a/spec/support/jekyll.rb b/spec/support/jekyll.rb index d6e4050..bf3d34b 100644 --- a/spec/support/jekyll.rb +++ b/spec/support/jekyll.rb @@ -1,4 +1,3 @@ - require 'jekyll' # Tools to build / compile the Jekyll site and extract the sitemap @@ -8,7 +7,7 @@ def site_config # Consider forcing the desination folder # Override the local URL too? Would it break the sitemap? # Note: Config keys must be strings and thus use => style hashes. - @site_config ||= Jekyll.configuration({'sass' => { 'quiet_deps' => true }}) + @site_config ||= Jekyll.configuration({ 'sass' => { 'quiet_deps' => true } }) end def build_jekyll_site! @@ -33,7 +32,6 @@ def load_sitemap end.sort end - # Start a local Rack server # https://nts.strzibny.name/how-to-test-static-sites-with-rspec-capybara-and-webkit/ class StaticSite