-
-
Notifications
You must be signed in to change notification settings - Fork 278
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/RepeatedExampleGroupDescription
#2021
Comments
RSpec/RepeatedExampleGroupDescription
copRSpec/RepeatedExampleGroupDescription
Shouldn't this be? - context 'when the request is valid', use_vcr_cassette: 'screenshots/invalid_request' do
+ context 'when the request is invalid', use_vcr_cassette: 'screenshots/invalid_request' do |
Sorry for the lack of explanation. No, it should work the same way as if it don't contain any metadata. P.S. And by accident, I combined two false negatives into one. Correct behavior: For instance, RSpec.describe Screenshots::CreateInteractor do
context 'when the request is valid' do
specify do
expect(true).to be_truthy
end
end
context 'when the request is valid' do
specify do
expect(false).to be_falsey
end
end
end I run rubocop: ydakuka@yauhenid:~/Work/project$ rubocop spec/interactors/screenshots/create_interactor_spec.rb
Inspecting 1 file
C
Offenses:
spec/interactors/screenshots/create_interactor_spec.rb:6:3: C: RSpec/RepeatedExampleGroupDescription: Repeated context block description on line(s) [12]
context 'when the request is valid' do ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/interactors/screenshots/create_interactor_spec.rb:12:3: C: RSpec/RepeatedExampleGroupDescription: Repeated context block description on line(s) [6]
context 'when the request is valid' do ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1 file inspected, 2 offenses detected False negatives
RSpec.describe Screenshots::CreateInteractor do
context 'when the request is valid', use_vcr_cassette: 'screenshots/valid_request' do
specify do
expect(true).to be_truthy
end
end
context 'when the request is valid' do
specify do
expect(false).to be_falsey
end
end
end or RSpec.describe Screenshots::CreateInteractor do
context 'when the request is valid', use_vcr_cassette: 'screenshots/valid_request' do
specify do
expect(true).to be_truthy
end
end
context 'when the request is valid', use_vcr_cassette: 'screenshots/invalid_request' do
specify do
expect(false).to be_falsey
end
end
end I run rubocop, and there are no offenses. Rubocop finds the Rubocop doesn't detect the RSpec.describe Screenshots::CreateInteractor do
context 'when the request is valid' do
pending 'add something'
end
context 'when the request is valid' do
pending 'add something'
end
end |
|
|
|
|
Describe the solution you'd like
RuboCop
The text was updated successfully, but these errors were encountered: