diff --git a/CHANGELOG.md b/CHANGELOG.md index f18a373..53440da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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`) diff --git a/README.md b/README.md index 55a2c9b..ef2f60b 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/config/rubocop-rspec.yml b/config/rubocop-rspec.yml new file mode 100644 index 0000000..1e5fb05 --- /dev/null +++ b/config/rubocop-rspec.yml @@ -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