Skip to content

Commit

Permalink
Proper lint for rubocop-rspec
Browse files Browse the repository at this point in the history
  • Loading branch information
ka8725 committed Apr 20, 2022
1 parent c86dc18 commit edb1557
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Saharspec history

## 0.0.9 -- 2022-20-04

* Properly lint RSpec specs using `its_block`/`its_call`/`its_map` with `rubocop-rspec` >= 2.0 ([@ka8725][])

## 0.0.8 -- 2020-10-10

* Better `dont` failure message (just use underlying matchers `failure_message_when_negated`)
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,16 @@ describe '#delete_at' do
end
```

### Linting with RuboCop RSpec

`rubocop-rspec` fails to properly detect RSpec constructs that Saharspec defines (`its_call`, `its_block`, `its_map`).
Make sure to use `rubocop-rspec` 2.0 or newer and add the following to your `.rubocop.yml`:

```yaml
inherit_gem:
saharaspec: config/rubocop-rspec.yml
```

## State & future

I use all of the components of the library on daily basis. Probably, I will extend it with other
Expand Down
13 changes: 13 additions & 0 deletions config/rubocop-rspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
RSpec:
Language:
Includes:
Examples:
- its_block
- its_call
- its_map
- fits_block
- fits_call
- fits_map
- xits_block
- xits_call
- xits_map

0 comments on commit edb1557

Please sign in to comment.