Skip to content

Commit 49c6e92

Browse files
committed
Correct some example descriptions
1 parent 7f9595a commit 49c6e92

10 files changed

+29
-29
lines changed

spec/rubocop/cop/layout/empty_line_after_guard_clause_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ def foo
484484
RUBY
485485
end
486486

487-
it 'does not register an offense and corrects when using `return` before guard condition with heredoc' do
487+
it 'does not register an offense when using `return` before guard condition with heredoc' do
488488
expect_no_offenses(<<~RUBY)
489489
def foo
490490
return true if <<~TEXT.length > bar
@@ -496,7 +496,7 @@ def foo
496496
RUBY
497497
end
498498

499-
it 'does not register an offense and corrects when using `raise` before guard condition with heredoc' do
499+
it 'does not register an offense when using `raise` before guard condition with heredoc' do
500500
expect_no_offenses(<<~RUBY)
501501
def foo
502502
raise if <<~TEXT.length > bar

spec/rubocop/cop/layout/empty_lines_around_attribute_accessor_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ class Foo
220220
RUBY
221221
end
222222

223-
it 'does not register an offense and corrects when using `if` ... `else` branches' do
223+
it 'does not register an offense when using `if` ... `else` branches' do
224224
expect_no_offenses(<<~RUBY)
225225
if condition
226226
attr_reader :foo

spec/rubocop/cop/layout/hash_alignment_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1361,7 +1361,7 @@ def self.scenarios_order
13611361

13621362
context 'when using hash value omission', :ruby31 do
13631363
context 'and aligned keys' do
1364-
it 'does not register an offense and corrects' do
1364+
it 'does not register an offense' do
13651365
expect_no_offenses(<<~RUBY)
13661366
foo ab: 1,
13671367
c:

spec/rubocop/cop/lint/redundant_dir_glob_sort_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,26 +87,26 @@
8787
end
8888

8989
context 'when Ruby 2.7 or lower', :ruby27, unsupported_on: :prism do
90-
it 'does not register an offense and correction when using `Dir.glob.sort`' do
90+
it 'does not register an offense when using `Dir.glob.sort`' do
9191
expect_no_offenses(<<~RUBY)
9292
Dir.glob(Rails.root.join('test', '*.rb')).sort.each(&method(:require))
9393
RUBY
9494
end
9595

96-
it 'does not register an offense and correction when using `::Dir.glob.sort`' do
96+
it 'does not register an offense when using `::Dir.glob.sort`' do
9797
expect_no_offenses(<<~RUBY)
9898
::Dir.glob(Rails.root.join('test', '*.rb')).sort.each(&method(:require))
9999
RUBY
100100
end
101101

102-
it 'does not register an offense and correction when using `Dir[].sort.each do`' do
102+
it 'does not register an offense when using `Dir[].sort.each do`' do
103103
expect_no_offenses(<<~RUBY)
104104
Dir['./lib/**/*.rb'].sort.each do |file|
105105
end
106106
RUBY
107107
end
108108

109-
it 'does not register an offense and correction when using `Dir[].sort.each(&do_something)`' do
109+
it 'does not register an offense when using `Dir[].sort.each(&do_something)`' do
110110
expect_no_offenses(<<~RUBY)
111111
Dir['./lib/**/*.rb'].sort.each(&method(:require))
112112
RUBY

spec/rubocop/cop/lint/redundant_require_statement_spec.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,55 +128,55 @@
128128
end
129129

130130
context 'when requiring `pp`' do
131-
it 'does not register an offense and corrects when using `PP.pp`' do
131+
it 'does not register an offense when using `PP.pp`' do
132132
expect_no_offenses(<<~RUBY)
133133
require 'pp'
134134
135135
PP.pp
136136
RUBY
137137
end
138138

139-
it 'does not register an offense and corrects when using `::PP.pp`' do
139+
it 'does not register an offense when using `::PP.pp`' do
140140
expect_no_offenses(<<~RUBY)
141141
require 'pp'
142142
143143
::PP.pp
144144
RUBY
145145
end
146146

147-
it 'does not register an offense and corrects when using `pretty_inspect`' do
147+
it 'does not register an offense when using `pretty_inspect`' do
148148
expect_no_offenses(<<~RUBY)
149149
require 'pp'
150150
151151
foo.pretty_inspect
152152
RUBY
153153
end
154154

155-
it 'does not register an offense and corrects when using `pretty_print`' do
155+
it 'does not register an offense when using `pretty_print`' do
156156
expect_no_offenses(<<~RUBY)
157157
require 'pp'
158158
159159
foo.pretty_print(pp_instance)
160160
RUBY
161161
end
162162

163-
it 'does not register an offense and corrects when using `pretty_print_cycle`' do
163+
it 'does not register an offense when using `pretty_print_cycle`' do
164164
expect_no_offenses(<<~RUBY)
165165
require 'pp'
166166
167167
foo.pretty_print_cycle(pp_instance)
168168
RUBY
169169
end
170170

171-
it 'does not register an offense and corrects when using `pretty_print_inspect`' do
171+
it 'does not register an offense when using `pretty_print_inspect`' do
172172
expect_no_offenses(<<~RUBY)
173173
require 'pp'
174174
175175
foo.pretty_print_inspect
176176
RUBY
177177
end
178178

179-
it 'does not register an offense and corrects when using `pretty_print_instance_variables`' do
179+
it 'does not register an offense when using `pretty_print_instance_variables`' do
180180
expect_no_offenses(<<~RUBY)
181181
require 'pp'
182182
@@ -219,7 +219,7 @@
219219
end
220220

221221
context 'target ruby version < 3.1', :ruby30, unsupported_on: :prism do
222-
it 'does not register an offense and corrects when using requiring `fiber`' do
222+
it 'does not register an offense when using requiring `fiber`' do
223223
expect_no_offenses(<<~RUBY)
224224
require 'fiber'
225225
RUBY

spec/rubocop/cop/lint/redundant_safe_navigation_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
RUBY
2121
end
2222

23-
it 'does not register an offense and corrects when `&.` is used for snake case const receiver' do
23+
it 'does not register an offense when `&.` is used for snake case const receiver' do
2424
expect_no_offenses(<<~RUBY)
2525
CONST&.do_something
2626
CONST_NAME&.do_something
@@ -102,7 +102,7 @@
102102
RUBY
103103
end
104104

105-
it 'does not register an offense and corrects when `&.` is used for `nil` literal' do
105+
it 'does not register an offense when `&.` is used for `nil` literal' do
106106
expect_no_offenses(<<~RUBY)
107107
nil&.to_i
108108
RUBY

spec/rubocop/cop/security/yaml_load_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@
4040
# Ruby 3.1+ (Psych 4) uses `Psych.load` as `Psych.safe_load` by default.
4141
# https://github.com/ruby/psych/pull/487
4242
context 'Ruby >= 3.1', :ruby31 do
43-
it 'does not register an offense and corrects load with a literal string' do
43+
it 'does not register an offense load with a literal string' do
4444
expect_no_offenses(<<~RUBY)
4545
YAML.load("--- !ruby/object:Foo {}", permitted_classes: [Foo])
4646
RUBY
4747
end
4848

49-
it 'does not register an offense and corrects a fully qualified `::YAML.load`' do
49+
it 'does not register an offense a fully qualified `::YAML.load`' do
5050
expect_no_offenses(<<~RUBY)
5151
::YAML.load("--- !ruby/object:Foo {}", permitted_classes: [Foo])
5252
RUBY

spec/rubocop/cop/style/collection_compact_spec.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def foo(params)
179179
RUBY
180180
end
181181

182-
it 'does not register an offense and corrects when using `grep_v(pattern)`' do
182+
it 'does not register an offense when using `grep_v(pattern)`' do
183183
expect_no_offenses(<<~RUBY)
184184
array.grep_v(pattern)
185185
RUBY
@@ -200,15 +200,15 @@ def foo(params)
200200
end
201201

202202
context 'when without receiver' do
203-
it 'does not register an offense and corrects when using `reject` on array to reject nils' do
203+
it 'does not register an offense when using `reject` on array to reject nils' do
204204
expect_no_offenses(<<~RUBY)
205205
reject { |e| e.nil? }
206206
delete_if { |e| e.nil? }
207207
reject! { |e| e.nil? }
208208
RUBY
209209
end
210210

211-
it 'does not register an offense and corrects when using `select/select!` to reject nils' do
211+
it 'does not register an offense when using `select/select!` to reject nils' do
212212
expect_no_offenses(<<~RUBY)
213213
select { |e| !e.nil? }
214214
select! { |k, v| !v.nil? }
@@ -231,7 +231,7 @@ def foo(params)
231231
RUBY
232232
end
233233

234-
it 'does not register an offense and corrects when using `to_enum.delete_if` on array to reject nils' do
234+
it 'does not register an offense when using `to_enum.delete_if` on array to reject nils' do
235235
expect_no_offenses(<<~RUBY)
236236
array.to_enum.delete_if { |e| e.nil? }
237237
RUBY
@@ -251,23 +251,23 @@ def foo(params)
251251
RUBY
252252
end
253253

254-
it 'does not register an offense and corrects when using `lazy.delete_if` on array to reject nils' do
254+
it 'does not register an offense when using `lazy.delete_if` on array to reject nils' do
255255
expect_no_offenses(<<~RUBY)
256256
array.lazy.delete_if { |e| e.nil? }
257257
RUBY
258258
end
259259
end
260260

261261
context 'Ruby <= 3.0', :ruby30, unsupported_on: :prism do
262-
it 'does not register an offense and corrects when using `to_enum.reject` on array to reject nils' do
262+
it 'does not register an offense when using `to_enum.reject` on array to reject nils' do
263263
expect_no_offenses(<<~RUBY)
264264
array.to_enum.reject { |e| e.nil? }
265265
array.to_enum.delete_if { |e| e.nil? }
266266
array.to_enum.reject! { |e| e.nil? }
267267
RUBY
268268
end
269269

270-
it 'does not register an offense and corrects when using `lazy.reject` on array to reject nils' do
270+
it 'does not register an offense when using `lazy.reject` on array to reject nils' do
271271
expect_no_offenses(<<~RUBY)
272272
array.lazy.reject { |e| e.nil? }
273273
array.lazy.delete_if { |e| e.nil? }

spec/rubocop/cop/style/redundant_regexp_character_class_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@
240240
end
241241

242242
context 'with a character class containing multiple unicode code-points' do
243-
it 'does not register an offense and corrects' do
243+
it 'does not register an offense' do
244244
expect_no_offenses(<<~'RUBY')
245245
foo = /[\u{0061 0062}]/
246246
RUBY

spec/rubocop/cop/style/single_argument_dig_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
RUBY
1515
end
1616

17-
it 'does not register an offense and corrects unsuitable use of dig with safe navigation operator' do
17+
it 'does not register an offense unsuitable use of dig with safe navigation operator' do
1818
expect_no_offenses(<<~RUBY)
1919
{ key: 'value' }&.dig(:key)
2020
RUBY

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy