diff --git a/Gemfile.lock b/Gemfile.lock index 85962b5..e5078cc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -19,6 +19,7 @@ GEM minitest (>= 5.1) tzinfo (~> 2.0) ast (2.4.2) + base64 (0.1.1) builder (3.2.4) concurrent-ruby (1.2.2) crass (1.0.6) @@ -26,7 +27,8 @@ GEM erubi (1.12.0) i18n (1.14.1) concurrent-ruby (~> 1.0) - json (2.6.2) + json (2.6.3) + language_server-protocol (3.17.0.3) loofah (2.21.3) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -37,9 +39,10 @@ GEM racc (~> 1.4) nokogiri (1.15.4-x86_64-linux) racc (~> 1.4) - parallel (1.22.1) - parser (3.1.2.0) + parallel (1.23.0) + parser (3.2.2.3) ast (~> 2.4.1) + racc racc (1.7.1) rack (3.0.8) rails-dom-testing (2.2.0) @@ -51,8 +54,8 @@ GEM nokogiri (~> 1.14) rainbow (3.1.1) rake (13.0.6) - regexp_parser (2.5.0) - rexml (3.2.5) + regexp_parser (2.8.1) + rexml (3.2.6) rspec (3.12.0) rspec-core (~> 3.12.0) rspec-expectations (~> 3.12.0) @@ -66,33 +69,35 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) rspec-support (3.12.1) - rubocop (1.31.2) + rubocop (1.56.3) + base64 (~> 0.1.1) json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.1.0.0) + parser (>= 3.2.2.3) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.18.0, < 2.0) + rubocop-ast (>= 1.28.1, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.19.1) - parser (>= 3.1.1.0) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.29.0) + parser (>= 3.2.1.0) rubocop-github (0.18.0) rubocop (>= 1.0.0) rubocop-performance rubocop-rails - rubocop-performance (1.14.3) + rubocop-performance (1.19.1) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) rubocop-rails (2.15.2) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.7.0, < 2.0) - ruby-progressbar (1.11.0) + ruby-progressbar (1.13.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.2.0) + unicode-display_width (2.4.2) PLATFORMS arm64-darwin-21 diff --git a/test/cop_test.rb b/test/cop_test.rb index d271106..bb9e298 100644 --- a/test/cop_test.rb +++ b/test/cop_test.rb @@ -11,13 +11,13 @@ def cop_class attr_reader :cop def setup - config = RuboCop::Config.new - @cop = cop_class.new(config) + @config = RuboCop::Config.new + @cop = cop_class.new(@config) end def investigate(cop, src, filename = nil) processed_source = RuboCop::ProcessedSource.new(src, RUBY_VERSION.to_f, filename) - team = RuboCop::Cop::Team.new([cop], nil, raise_error: true) + team = RuboCop::Cop::Team.new([cop], @config, raise_error: true) report = team.investigate(processed_source) report.offenses end diff --git a/test/test_image_has_alt.rb b/test/test_image_has_alt.rb index 7e79b47..5cf5fee 100644 --- a/test/test_image_has_alt.rb +++ b/test/test_image_has_alt.rb @@ -15,7 +15,7 @@ def test_image_has_alt_offense ERB assert_equal 1, offenses.count - assert_equal "Images should have an alt prop with meaningful text or an empty string for decorative images", + assert_equal "RailsAccessibility/ImageHasAlt: Images should have an alt prop with meaningful text or an empty string for decorative images", offenses[0].message end diff --git a/test/test_no_positive_tabindex.rb b/test/test_no_positive_tabindex.rb index cfb611b..e8a5165 100644 --- a/test/test_no_positive_tabindex.rb +++ b/test/test_no_positive_tabindex.rb @@ -15,7 +15,7 @@ def test_no_positive_tabindex_alt_offense ERB assert_equal 1, offenses.count - assert_equal "Positive tabindex is error-prone and often inaccessible.", offenses[0].message + assert_equal "RailsAccessibility/NoPositiveTabindex: Positive tabindex is error-prone and often inaccessible.", offenses[0].message end def test_no_positive_tabindex_alt_no_offense diff --git a/test/test_no_redundant_image_alt.rb b/test/test_no_redundant_image_alt.rb index 01b5fdf..ffc1418 100644 --- a/test/test_no_redundant_image_alt.rb +++ b/test/test_no_redundant_image_alt.rb @@ -15,7 +15,7 @@ def test_no_redundant_image_alt_offense ERB assert_equal 1, offenses.count - assert_equal "Alt prop should not contain `image` or `picture` as screen readers already announce the element as an image", + assert_equal "RailsAccessibility/NoRedundantImageAlt: Alt prop should not contain `image` or `picture` as screen readers already announce the element as an image", offenses[0].message end