From 8cfe4c57d4e9f4ccc6b225e781dd35bf2fd520cf Mon Sep 17 00:00:00 2001 From: ydah Date: Wed, 25 Dec 2024 23:05:21 +0900 Subject: [PATCH] Remove an example which is a syntax error in Ruby's parser MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. https://github.com/rubocop/rubocop-rspec/pull/2014#discussion_r1897371078 --- .../cop/rspec/pending_without_reason_spec.rb | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/spec/rubocop/cop/rspec/pending_without_reason_spec.rb b/spec/rubocop/cop/rspec/pending_without_reason_spec.rb index 9e678e859..4c6a70f91 100644 --- a/spec/rubocop/cop/rspec/pending_without_reason_spec.rb +++ b/spec/rubocop/cop/rspec/pending_without_reason_spec.rb @@ -300,35 +300,6 @@ end RUBY end - - context 'with a numblock' do - it 'registers offense' do - expect_offense(<<~RUBY) - RSpec.describe Foo do - pending - ^^^^^^^ Give the reason for pending. - skip - ^^^^ Give the reason for skip. - _1 - context 'when something' do - _1 - pending - ^^^^^^^ Give the reason for pending. - skip - ^^^^ Give the reason for skip. - it 'does something' do - _1 - skip - ^^^^ Give the reason for skip. - pending - ^^^^^^^ Give the reason for pending. - _1 - end - end - end - RUBY - end - end end context 'when pending/skip inside conditional' do