Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False negative for RSpec/Pending in 2.16.0 when reason is some forms of multiline string #1540

Closed
Tabby opened this issue Jan 5, 2023 · 0 comments · Fixed by #1541
Closed

Comments

@Tabby
Copy link

Tabby commented Jan 5, 2023

Hi rubocop-rspec team,

When fixing cop violations from the new RSpec/PendingWithoutReason cop, I found that using some forms of multiline string for the pending reason caused the RSpec/Pending cop to no longer trigger for pending specs. For example, these forms were correctly flagged as being pending specs:

it "does do the right thing", pending: "bad spec" do
  ...
end
it "does the right thing", pending: "According to all known laws of aviation, \
                                     there is no way a spec should be able to fly." do
  ...
end

These forms were not:

it "does the right thing", pending: "’Twas brillig, and the slithy specs " \
                                    "Did gyre and gimble in the wabe" do
  ...
end
it "does the right thing", pending: "The sun was shining on the spec,
                                     Shining with all his might" do
  ...
end
it "does the right thing", pending: %(It was the best of specs,
                                     it was the worst of specs) do
  ...
end

A minor issue at worst, but I figured I'd raise it having seen it :)

(Ruby 3.1.6, rubocop 1.41.1, rubocop-ast 1.24.1, rubocop-rspec 2.16.0)

ydah added a commit to ydah/rubocop-rspec that referenced this issue Jan 6, 2023
…c/NoExpectationExample` when using skipped in metadata is multiline string

Fix: rubocop#1540
ydah added a commit to ydah/rubocop-rspec that referenced this issue Jan 7, 2023
…c/NoExpectationExample` when using skipped in metadata is multiline string

Fix: rubocop#1540
ydah added a commit to ydah/rubocop-rspec that referenced this issue Jan 13, 2023
…c/NoExpectationExample` when using skipped in metadata is multiline string

Fix: rubocop#1540
ydah added a commit to rubocop/rubocop-factory_bot that referenced this issue Apr 13, 2023
…c/NoExpectationExample` when using skipped in metadata is multiline string

Fix: rubocop/rubocop-rspec#1540
ydah added a commit to rubocop/rubocop-rspec_rails that referenced this issue Mar 27, 2024
…c/NoExpectationExample` when using skipped in metadata is multiline string

Fix: rubocop/rubocop-rspec#1540
ydah added a commit to rubocop/rubocop-rspec_rails that referenced this issue Mar 27, 2024
…c/NoExpectationExample` when using skipped in metadata is multiline string

Fix: rubocop/rubocop-rspec#1540
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant