Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR fixes the following build failures when using Prism 1.1+. ```console $ bundle exec prism_spec (snip) Failed examples: rspec './spec/rubocop/ast/next_node_spec.rb[1:1:2:4:1]' # RuboCop::AST::NextNode behaves like wrapped arguments node #arguments with a single argument and braces rspec './spec/rubocop/ast/next_node_spec.rb[1:1:2:1:1]' # RuboCop::AST::NextNode behaves like wrapped arguments node #arguments with no arguments rspec './spec/rubocop/ast/next_node_spec.rb[1:1:2:3:1]' # RuboCop::AST::NextNode behaves like wrapped arguments node #arguments with a single argument rspec './spec/rubocop/ast/next_node_spec.rb[1:1:2:2:1]' # RuboCop::AST::NextNode behaves like wrapped arguments node #arguments with no arguments and braces rspec './spec/rubocop/ast/next_node_spec.rb[1:1:2:6:1]' # RuboCop::AST::NextNode behaves like wrapped arguments node #arguments with multiple literal arguments rspec './spec/rubocop/ast/next_node_spec.rb[1:1:2:5:1]' # RuboCop::AST::NextNode behaves like wrapped arguments node #arguments with a single splat argument rspec './spec/rubocop/ast/next_node_spec.rb[1:1:1:1:1]' # RuboCop::AST::NextNode behaves like wrapped arguments node .new without arguments is expected to be a kind of RuboCop::AST::NextNode rspec './spec/rubocop/ast/next_node_spec.rb[1:1:1:2:1]' # RuboCop::AST::NextNode behaves like wrapped arguments node .new with arguments is expected to be a kind of RuboCop::AST::NextNode rspec './spec/rubocop/ast/break_node_spec.rb[1:1:2:5:1]' # RuboCop::AST::BreakNode behaves like wrapped arguments node #arguments with a single splat argument rspec './spec/rubocop/ast/break_node_spec.rb[1:1:2:6:1]' # RuboCop::AST::BreakNode behaves like wrapped arguments node #arguments with multiple literal arguments rspec './spec/rubocop/ast/break_node_spec.rb[1:1:2:1:1]' # RuboCop::AST::BreakNode behaves like wrapped arguments node #arguments with no arguments rspec './spec/rubocop/ast/break_node_spec.rb[1:1:2:4:1]' # RuboCop::AST::BreakNode behaves like wrapped arguments node #arguments with a single argument and braces rspec './spec/rubocop/ast/break_node_spec.rb[1:1:2:3:1]' # RuboCop::AST::BreakNode behaves like wrapped arguments node #arguments with a single argument rspec './spec/rubocop/ast/break_node_spec.rb[1:1:2:2:1]' # RuboCop::AST::BreakNode behaves like wrapped arguments node #arguments with no arguments and braces rspec './spec/rubocop/ast/break_node_spec.rb[1:1:1:2:1]' # RuboCop::AST::BreakNode behaves like wrapped arguments node .new with arguments is expected to be a kind of RuboCop::AST::BreakNode rspec './spec/rubocop/ast/break_node_spec.rb[1:1:1:1:1]' # RuboCop::AST::BreakNode behaves like wrapped arguments node .new without arguments is expected to be a kind of RuboCop::AST::BreakNode ``` This is due to Prism 1.1 providing the correct behavior equivalent to Ruby's parse.y. As of Ruby 3.3, using `next` and `break` at the top level results in a syntax error. This PR ensures proper validation by enclosing them in blocks for testing.
- Loading branch information