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

Proper lint for rubocop-rspec #5

Merged
merged 1 commit into from Apr 29, 2022
Merged

Conversation

ka8725
Copy link
Contributor

@ka8725 ka8725 commented Apr 20, 2022

The default configuration of Rubocop RSpec fails to detect constructions its_block/its_call/its_map defined by Saharaspec.

This PR fixes the issue.

Consider the following example:

# cat spec/example_spec.rb
describe 'Saharaspec' do
  context 'text' do
    subject { 'x' }

    its_block { is_expected.to eq 'x' }
  end
end

As default rubocop command fails as this:

spec/example_spec.rb:2:3: C: RSpec/EmptyExampleGroup: Empty example group detected.
  context 'text' do
  ^^^^^^^^^^^^^^

Install the fix locally updating Gemfile as follows:

gem 'saharspec', require: false, path: '<path_to_local_dir>/saharspec'

Add these lines to .rubocop.yml of you project:

inherit_gem:
  saharspec: config/rubocop-rspec.yml

And now Rubocop has no complains.

This is a follow up on this issue rubocop/rubocop-rspec#975

saharspec.gemspec Outdated Show resolved Hide resolved
@zverok zverok merged commit 5adc860 into zverok:master Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants