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