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

```ruby expect([-1,2,3]).to all be(&:positive?) ``` will pass. There is [no warning/error emitted by RSpec](https://github.com/rspec/rspec-expectations/issues/1194). ~Does it make sense to create a cop to catch this in RSpec versions before it's...

cop

The `feature` method added by Capybara defines two pieces of metadata on the block - `type: features` and `capybara_feature: true` - it can't just be replaced by `describe`

How should one use the RSpec/ContextWording with nested contexts? Should it support 'and with/when' such that when I do: ```ruby describe 'The program' do context 'when configured' do context 'and...

I really like enforcing one expectation per example. But with RSpec's exception matching, you need two `expect` calls if you want to assert something about an exception: ``` expect {...

enhancement
help wanted
good first issue

A cop to enforce hook ordering: before :suite before :context before :example around :example after :example after :context after :suite

cop

These two cops are almost identical. Would it make sense to extract some shared code from them? @Darhazer @dgollahon

`render_views` couples together controller and view tests, which some may find undesirable. Rubocop could help out by adding a cop forbidding use of that feature?

Hopefully it will save time. Without `require: false` to this gem in `Gemfile`, the following crash will occur. Happened to both ruby 2.6.0 and 2.6.2. ```/Users/gbudiman/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/timeout.rb:86: [BUG] Segmentation fault at...

Example: ```Ruby let(:fit) { Tax.federal_income_tax } let(:fit_attributes) { tax_id: fit.id } ``` raises ``` C: RSpec/Focus: Focused spec found. { tax_id: fit.id } ^^^ ```

bug
help wanted

I don't know if this is the sort of thing that would result in a lot of false positives, but I like conditions in a spec description to use consistent...

cop