nevir/rubocop-rspec

View on GitHub
docs/modules/ROOT/pages/upgrade_to_version_3.adoc

Summary

Maintainability
Test Coverage
= Upgrade to Version 3.x
:doctype: book

== Configuration File Update

In version 3.x:

 - cop departments are extracted to another gem. (`Capybara`, `FactoryBot`, `Rails`)

[discrete]
=== Extraction of cop departments. (`Capybara`, `FactoryBot`, `Rails`)

If you are using the RSpec/Capybara, RSpec/FactoryBot, or RSpec/Rails departments, you need to install the corresponding gem and add it to your `.rubocop.yml` file.

For example, if you are using the RSpec/Capybara department, you need to install the `rubocop-capybara` gem and add it to your `.rubocop.yml` file:

[source,ruby]
----
# Gemfile
group :test do
  gem 'rubocop-rspec'
  gem 'rubocop-capybara'
end
----

[source,yaml]
----
Capybara:
  Enabled: true
----

And you need to remove the old department in your `.rubocop.yml` file:

[source,yaml]
----
RSpec/Capybara:
  Enabled: false
----

For another example, if you are not using these departments, you don't need to do anything.
And when you update to RuboCop RSpec v3.0.0, you need to remove the old departments from your `.rubocop.yml` file, e.g.:

[source,yaml]
----
RSpec/Capybara:
  Enabled: false
RSpec/FactoryBot:
  Enabled: false
RSpec/Rails:
  Enabled: false
----