Skip to content

Commit 2eb60ff

Browse files
committed
Update the test setup
With the latest rubocop-performance update, the tests are failing to run. It looks like we need to update the setup. Based off of rubocop/rubocop-minitest@a96a985.
1 parent 3adf59a commit 2eb60ff

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

test/cop_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ def cop_class
1111
attr_reader :cop
1212

1313
def setup
14-
config = RuboCop::Config.new
15-
@cop = cop_class.new(config)
14+
@config = RuboCop::Config.new
15+
@cop = cop_class.new(@config)
1616
end
1717

1818
def investigate(cop, src, filename = nil)
1919
processed_source = RuboCop::ProcessedSource.new(src, RUBY_VERSION.to_f, filename)
20-
team = RuboCop::Cop::Team.new([cop], nil, raise_error: true)
20+
team = RuboCop::Cop::Team.new([cop], @config, raise_error: true)
2121
report = team.investigate(processed_source)
2222
report.offenses
2323
end

test/test_image_has_alt.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def test_image_has_alt_offense
1515
ERB
1616

1717
assert_equal 1, offenses.count
18-
assert_equal "Images should have an alt prop with meaningful text or an empty string for decorative images",
18+
assert_equal "RailsAccessibility/ImageHasAlt: Images should have an alt prop with meaningful text or an empty string for decorative images",
1919
offenses[0].message
2020
end
2121

test/test_no_positive_tabindex.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def test_no_positive_tabindex_alt_offense
1515
ERB
1616

1717
assert_equal 1, offenses.count
18-
assert_equal "Positive tabindex is error-prone and often inaccessible.", offenses[0].message
18+
assert_equal "RailsAccessibility/NoPositiveTabindex: Positive tabindex is error-prone and often inaccessible.", offenses[0].message
1919
end
2020

2121
def test_no_positive_tabindex_alt_no_offense

test/test_no_redundant_image_alt.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def test_no_redundant_image_alt_offense
1515
ERB
1616

1717
assert_equal 1, offenses.count
18-
assert_equal "Alt prop should not contain `image` or `picture` as screen readers already announce the element as an image",
18+
assert_equal "RailsAccessibility/NoRedundantImageAlt: Alt prop should not contain `image` or `picture` as screen readers already announce the element as an image",
1919
offenses[0].message
2020
end
2121

0 commit comments

Comments
 (0)