rubocop-rspec icon indicating copy to clipboard operation
rubocop-rspec copied to clipboard

Code style checking for RSpec files

Results 163 rubocop-rspec issues
Sort by recently updated
recently updated
newest added

Resolve: #1356 Concerns include the following: `RSpec/ContextWording` prefix match checking is strict as follows. ```ruby # for example - `Prefixes: [when]` # good context 'when something' do end # bad...

Per issue #1337, I tried to add a generic way to the ExampleWordingCop to call out insufficient descriptions. For now, I've used "works" and "throws errors" as that is a...

It would be nice to have a new cop similar to the `Style/ClassCheck` cop. - https://docs.rubocop.org/rubocop/cops_style.html#styleclasscheck --- Before submitting the PR make sure the following are checked: * [x] Feature...

This cop sorts the RSpec metadata alphabetically: ```ruby # bad describe 'Something', :b, :a context 'Something', foo: 'bar', baz: true it 'works', :b, :a, foo: 'bar', baz: true # good...

https://docs.rubocop.org/rubocop-rspec/cops_rspec.html#rspeccontextwording Currently only `prefix` is supported for `RSpec/ContextWording`, but for some languages, only prefix cannot make description sound natural. I'm a native speaker of Japanese so here I'd like to...

Follow up https://github.com/rubocop/rubocop/pull/10555 This PR obsoletes the `IgnoredPatterns` option and replaces it with the `AllowedPatterns` option. --- Before submitting the PR make sure the following are checked: * [x] Feature...

```rb expect(page).to have_selector('button:first-of-type:focus') ``` This gives a warning but I don't think it's possible to express this with `have_button`. cc @ydah

I'm using `&` matcher, which doesn't work with negative form. https://github.com/rspec/rspec-expectations/blob/main/lib/rspec/matchers/composable.rb#L25 In this case, auto-correct can be unsafe. Example: ```rb expect { subject }.to change { Task.count }.by(0) & change...

I see too many this: ```ruby it "works" do # ... end ``` Specs are not just here to prevent bugs, but are, as the name implies, specifications. In other...

cop
good first issue

original issue: https://github.com/rubocop/rubocop-rspec/issues/1342#issue-1322935208 ```ruby # bad expect(find('input').value).to eq('foobar') # good expect(page).to have_field(with: 'foobar') ```