Skip to content

Commit 8cfe4c5

Browse files
committed
Remove an example which is a syntax error in Ruby's parser
This code generates a syntax error as follows: ```ruby ❯ ruby -e '[1].each { put _1; [1].each { put _1 } }' -e: -e:1: syntax error found (SyntaxError) > 1 | ... _1 } } | ^~ numbered parameter is already used in outer block ``` When numbered parameters are used in nested blocks, it is not possible to use numbered parameters in multiple different hierarchies. While it was considered to split these up, we discussed below. #2014 (comment)
1 parent 5d768fe commit 8cfe4c5

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

spec/rubocop/cop/rspec/pending_without_reason_spec.rb

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -300,35 +300,6 @@
300300
end
301301
RUBY
302302
end
303-
304-
context 'with a numblock' do
305-
it 'registers offense' do
306-
expect_offense(<<~RUBY)
307-
RSpec.describe Foo do
308-
pending
309-
^^^^^^^ Give the reason for pending.
310-
skip
311-
^^^^ Give the reason for skip.
312-
_1
313-
context 'when something' do
314-
_1
315-
pending
316-
^^^^^^^ Give the reason for pending.
317-
skip
318-
^^^^ Give the reason for skip.
319-
it 'does something' do
320-
_1
321-
skip
322-
^^^^ Give the reason for skip.
323-
pending
324-
^^^^^^^ Give the reason for pending.
325-
_1
326-
end
327-
end
328-
end
329-
RUBY
330-
end
331-
end
332303
end
333304

334305
context 'when pending/skip inside conditional' do

0 commit comments

Comments
 (0)