diff --git a/spec/rubocop/cop/rails/blank_spec.rb b/spec/rubocop/cop/rails/blank_spec.rb index c5fab52ae5..6b53515624 100644 --- a/spec/rubocop/cop/rails/blank_spec.rb +++ b/spec/rubocop/cop/rails/blank_spec.rb @@ -2,9 +2,7 @@ RSpec.describe RuboCop::Cop::Rails::Blank, :config do shared_examples 'offense' do |source, correction, message| - # FIXME: `undefined method `[]' for nil` occurs Prism 0.24.0. It has been resolved in - # the development line. This will be resolved in Prism > 0.24.0 and higher releases. - it 'registers an offense and corrects', broken_on: :prism do + it 'registers an offense and corrects' do expect_offense(<<~RUBY, source: source, message: message) #{source} ^{source} #{message} diff --git a/spec/rubocop/cop/rails/exit_spec.rb b/spec/rubocop/cop/rails/exit_spec.rb index 2bafd54efe..b593fa45d4 100644 --- a/spec/rubocop/cop/rails/exit_spec.rb +++ b/spec/rubocop/cop/rails/exit_spec.rb @@ -8,9 +8,7 @@ RUBY end - # FIXME: `undefined method `[]' for nil` occurs Prism 0.24.0. It has been resolved in - # the development line. This will be resolved in Prism > 0.24.0 and higher releases. - it 'registers an offense for an exit! call with no receiver', broken_on: :prism do + it 'registers an offense for an exit! call with no receiver' do expect_offense(<<~RUBY) exit! ^^^^^ Do not use `exit` in Rails applications. diff --git a/spec/rubocop/cop/rails/present_spec.rb b/spec/rubocop/cop/rails/present_spec.rb index ebb3d3d69b..a547de99a6 100644 --- a/spec/rubocop/cop/rails/present_spec.rb +++ b/spec/rubocop/cop/rails/present_spec.rb @@ -2,9 +2,7 @@ RSpec.describe RuboCop::Cop::Rails::Present, :config do shared_examples 'offense' do |source, correction, message| - # FIXME: `undefined method `[]' for nil` occurs Prism 0.24.0. It has been resolved in - # the development line. This will be resolved in Prism > 0.24.0 and higher releases. - it 'registers an offense and corrects', broken_on: :prism do + it 'registers an offense and corrects' do expect_offense(<<~RUBY, source: source, message: message) #{source} ^{source} #{message} diff --git a/spec/rubocop/cop/rails/safe_navigation_spec.rb b/spec/rubocop/cop/rails/safe_navigation_spec.rb index f699b147d1..20d6e0ae38 100644 --- a/spec/rubocop/cop/rails/safe_navigation_spec.rb +++ b/spec/rubocop/cop/rails/safe_navigation_spec.rb @@ -119,12 +119,7 @@ it_behaves_like 'autocorrect', 'try! with 2 parameters', '[1, 2].try!(:join, ",")', '[1, 2]&.join(",")' it_behaves_like 'autocorrect', 'try! with multiple parameters', '[1, 2].try!(:join, bar, baz)', '[1, 2]&.join(bar, baz)' - # FIXME: `undefined method `[]' for nil` occurs Prism 0.24.0. It has been resolved in - # the development line. This will be resolved in Prism > 0.24.0 and higher releases. - context 'skip test when parser engine is prism', broken_on: :prism do - it_behaves_like 'autocorrect', 'try! without receiver', 'try!(:join)', 'self&.join' - end - + it_behaves_like 'autocorrect', 'try! without receiver', 'try!(:join)', 'self&.join' it_behaves_like 'autocorrect', 'try! with a block', ['[foo, bar].try!(:map) do |e|', ' e.some_method', diff --git a/spec/rubocop/cop/rails/save_bang_spec.rb b/spec/rubocop/cop/rails/save_bang_spec.rb index 8514fb1bcc..c036b194a6 100644 --- a/spec/rubocop/cop/rails/save_bang_spec.rb +++ b/spec/rubocop/cop/rails/save_bang_spec.rb @@ -74,9 +74,7 @@ end end - # FIXME: `undefined method `[]' for nil` occurs Prism 0.24.0. It has been resolved in - # the development line. This will be resolved in Prism > 0.24.0 and higher releases. - it "when using #{method} without arguments", broken_on: :prism do + it "when using #{method} without arguments" do expect_offense(<<~RUBY, method: method) #{method} ^{method} Use `#{method}!` instead of `#{method}` if the return value is not checked. diff --git a/spec/rubocop/cop/rails/skips_model_validations_spec.rb b/spec/rubocop/cop/rails/skips_model_validations_spec.rb index 4a19f6cca3..4e430f23c4 100644 --- a/spec/rubocop/cop/rails/skips_model_validations_spec.rb +++ b/spec/rubocop/cop/rails/skips_model_validations_spec.rb @@ -66,27 +66,21 @@ RUBY end - # FIXME: `undefined method `[]' for nil` occurs Prism 0.24.0. It has been resolved in - # the development line. This will be resolved in Prism > 0.24.0 and higher releases. - it "registers an offense for #{method} with `:returning` keyword argument", broken_on: :prism do + it "registers an offense for #{method} with `:returning` keyword argument" do expect_offense(<<~RUBY, method: method) %{method}(attributes, returning: false) ^{method} Avoid using `#{method}` because it skips validations. RUBY end - # FIXME: `undefined method `[]' for nil` occurs Prism 0.24.0. It has been resolved in - # the development line. This will be resolved in Prism > 0.24.0 and higher releases. - it "registers an offense for #{method} with `:unique_by` keyword argument", broken_on: :prism do + it "registers an offense for #{method} with `:unique_by` keyword argument" do expect_offense(<<~RUBY, method: method) %{method}(attributes, unique_by: :username) ^{method} Avoid using `#{method}` because it skips validations. RUBY end - # FIXME: `undefined method `[]' for nil` occurs Prism 0.24.0. It has been resolved in - # the development line. This will be resolved in Prism > 0.24.0 and higher releases. - it "registers an offense for #{method} with both `:returning` and `:unique_by` keyword arguments", broken_on: :prism do # rubocop:disable Layout/LineLength + it "registers an offense for #{method} with both `:returning` and `:unique_by` keyword arguments" do expect_offense(<<~RUBY, method: method) %{method}(attributes, returning: false, unique_by: :username) ^{method} Avoid using `#{method}` because it skips validations. diff --git a/spec/rubocop/cop/rails/where_exists_spec.rb b/spec/rubocop/cop/rails/where_exists_spec.rb index d47b29c460..1fade2409c 100644 --- a/spec/rubocop/cop/rails/where_exists_spec.rb +++ b/spec/rubocop/cop/rails/where_exists_spec.rb @@ -59,9 +59,7 @@ RUBY end - # FIXME: `undefined method `[]' for nil` occurs Prism 0.24.0. It has been resolved in - # the development line. This will be resolved in Prism > 0.24.0 and higher releases. - it 'registers an offense when using implicit receiver and arg', broken_on: :prism do + it 'registers an offense when using implicit receiver and arg' do expect_offense(<<~RUBY) where('name = ?', 'john').exists? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `exists?(['name = ?', 'john'])` over `where('name = ?', 'john').exists?`. @@ -155,9 +153,7 @@ RUBY end - # FIXME: `undefined method `[]' for nil` occurs Prism 0.24.0. It has been resolved in - # the development line. This will be resolved in Prism > 0.24.0 and higher releases. - it 'registers an offense when using implicit receiver and arg', broken_on: :prism do + it 'registers an offense when using implicit receiver and arg' do expect_offense(<<~RUBY) exists?('name = ?', 'john') ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `where('name = ?', 'john').exists?` over `exists?('name = ?', 'john')`.