Skip to content

Commit b2c2450

Browse files
authored
Merge pull request #1275 from koic/restore_skipping_specs_for_prism
Restore skipped specs for Prism
2 parents 507c88c + 4f43d8f commit b2c2450

7 files changed

+10
-33
lines changed

Diff for: spec/rubocop/cop/rails/blank_spec.rb

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
RSpec.describe RuboCop::Cop::Rails::Blank, :config do
44
shared_examples 'offense' do |source, correction, message|
5-
# FIXME: `undefined method `[]' for nil` occurs Prism 0.24.0. It has been resolved in
6-
# the development line. This will be resolved in Prism > 0.24.0 and higher releases.
7-
it 'registers an offense and corrects', broken_on: :prism do
5+
it 'registers an offense and corrects' do
86
expect_offense(<<~RUBY, source: source, message: message)
97
#{source}
108
^{source} #{message}

Diff for: spec/rubocop/cop/rails/exit_spec.rb

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
RUBY
99
end
1010

11-
# FIXME: `undefined method `[]' for nil` occurs Prism 0.24.0. It has been resolved in
12-
# the development line. This will be resolved in Prism > 0.24.0 and higher releases.
13-
it 'registers an offense for an exit! call with no receiver', broken_on: :prism do
11+
it 'registers an offense for an exit! call with no receiver' do
1412
expect_offense(<<~RUBY)
1513
exit!
1614
^^^^^ Do not use `exit` in Rails applications.

Diff for: spec/rubocop/cop/rails/present_spec.rb

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
RSpec.describe RuboCop::Cop::Rails::Present, :config do
44
shared_examples 'offense' do |source, correction, message|
5-
# FIXME: `undefined method `[]' for nil` occurs Prism 0.24.0. It has been resolved in
6-
# the development line. This will be resolved in Prism > 0.24.0 and higher releases.
7-
it 'registers an offense and corrects', broken_on: :prism do
5+
it 'registers an offense and corrects' do
86
expect_offense(<<~RUBY, source: source, message: message)
97
#{source}
108
^{source} #{message}

Diff for: spec/rubocop/cop/rails/safe_navigation_spec.rb

+1-6
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,7 @@
119119
it_behaves_like 'autocorrect', 'try! with 2 parameters', '[1, 2].try!(:join, ",")', '[1, 2]&.join(",")'
120120
it_behaves_like 'autocorrect', 'try! with multiple parameters',
121121
'[1, 2].try!(:join, bar, baz)', '[1, 2]&.join(bar, baz)'
122-
# FIXME: `undefined method `[]' for nil` occurs Prism 0.24.0. It has been resolved in
123-
# the development line. This will be resolved in Prism > 0.24.0 and higher releases.
124-
context 'skip test when parser engine is prism', broken_on: :prism do
125-
it_behaves_like 'autocorrect', 'try! without receiver', 'try!(:join)', 'self&.join'
126-
end
127-
122+
it_behaves_like 'autocorrect', 'try! without receiver', 'try!(:join)', 'self&.join'
128123
it_behaves_like 'autocorrect', 'try! with a block',
129124
['[foo, bar].try!(:map) do |e|',
130125
' e.some_method',

Diff for: spec/rubocop/cop/rails/save_bang_spec.rb

+1-3
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@
7474
end
7575
end
7676

77-
# FIXME: `undefined method `[]' for nil` occurs Prism 0.24.0. It has been resolved in
78-
# the development line. This will be resolved in Prism > 0.24.0 and higher releases.
79-
it "when using #{method} without arguments", broken_on: :prism do
77+
it "when using #{method} without arguments" do
8078
expect_offense(<<~RUBY, method: method)
8179
#{method}
8280
^{method} Use `#{method}!` instead of `#{method}` if the return value is not checked.

Diff for: spec/rubocop/cop/rails/skips_model_validations_spec.rb

+3-9
Original file line numberDiff line numberDiff line change
@@ -66,27 +66,21 @@
6666
RUBY
6767
end
6868

69-
# FIXME: `undefined method `[]' for nil` occurs Prism 0.24.0. It has been resolved in
70-
# the development line. This will be resolved in Prism > 0.24.0 and higher releases.
71-
it "registers an offense for #{method} with `:returning` keyword argument", broken_on: :prism do
69+
it "registers an offense for #{method} with `:returning` keyword argument" do
7270
expect_offense(<<~RUBY, method: method)
7371
%{method}(attributes, returning: false)
7472
^{method} Avoid using `#{method}` because it skips validations.
7573
RUBY
7674
end
7775

78-
# FIXME: `undefined method `[]' for nil` occurs Prism 0.24.0. It has been resolved in
79-
# the development line. This will be resolved in Prism > 0.24.0 and higher releases.
80-
it "registers an offense for #{method} with `:unique_by` keyword argument", broken_on: :prism do
76+
it "registers an offense for #{method} with `:unique_by` keyword argument" do
8177
expect_offense(<<~RUBY, method: method)
8278
%{method}(attributes, unique_by: :username)
8379
^{method} Avoid using `#{method}` because it skips validations.
8480
RUBY
8581
end
8682

87-
# FIXME: `undefined method `[]' for nil` occurs Prism 0.24.0. It has been resolved in
88-
# the development line. This will be resolved in Prism > 0.24.0 and higher releases.
89-
it "registers an offense for #{method} with both `:returning` and `:unique_by` keyword arguments", broken_on: :prism do # rubocop:disable Layout/LineLength
83+
it "registers an offense for #{method} with both `:returning` and `:unique_by` keyword arguments" do
9084
expect_offense(<<~RUBY, method: method)
9185
%{method}(attributes, returning: false, unique_by: :username)
9286
^{method} Avoid using `#{method}` because it skips validations.

Diff for: spec/rubocop/cop/rails/where_exists_spec.rb

+2-6
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@
5959
RUBY
6060
end
6161

62-
# FIXME: `undefined method `[]' for nil` occurs Prism 0.24.0. It has been resolved in
63-
# the development line. This will be resolved in Prism > 0.24.0 and higher releases.
64-
it 'registers an offense when using implicit receiver and arg', broken_on: :prism do
62+
it 'registers an offense when using implicit receiver and arg' do
6563
expect_offense(<<~RUBY)
6664
where('name = ?', 'john').exists?
6765
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `exists?(['name = ?', 'john'])` over `where('name = ?', 'john').exists?`.
@@ -155,9 +153,7 @@
155153
RUBY
156154
end
157155

158-
# FIXME: `undefined method `[]' for nil` occurs Prism 0.24.0. It has been resolved in
159-
# the development line. This will be resolved in Prism > 0.24.0 and higher releases.
160-
it 'registers an offense when using implicit receiver and arg', broken_on: :prism do
156+
it 'registers an offense when using implicit receiver and arg' do
161157
expect_offense(<<~RUBY)
162158
exists?('name = ?', 'john')
163159
^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `where('name = ?', 'john').exists?` over `exists?('name = ?', 'john')`.

0 commit comments

Comments
 (0)