You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-3Lines changed: 18 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -97,15 +97,15 @@ Here are the Markdown snippets for the two badges:
97
97
98
98
## Using this Gem for testing custom cops
99
99
100
-
You can use this gem to test your own cops, by using the `Rubocop::Minitest::Test` test class, you'll get `assert_offense`, `assert_correction`, and `assert_no_offense` helpers
100
+
You can use this gem to test your own cops, by using the `RuboCop::Minitest::Test` test class, you'll get `assert_offense`, `assert_correction`, and `assert_no_offense` helpers
101
101
102
102
```ruby
103
103
104
104
require "rubocop/minitest/support"
105
105
require "custom_cops/my_cop"
106
106
107
107
module CustomCops
108
-
class MyCopTest < Rubocop::Minitest::Test
108
+
class MyCopTest < RuboCop::Minitest::Test
109
109
test "registers offense" do
110
110
assert_offense(<<~RUBY)
111
111
class FooTest < Minitest::Test
@@ -158,9 +158,24 @@ module CustomCops
158
158
end
159
159
RUBY
160
160
end
161
+
162
+
# You can set the `@cop` attribute to override the auto-detected cop and provide configuration options
0 commit comments