Upgrading rubocop-rspec 2 to 3
Breaking2.31.0 → 3.10.2Breaking4Deprecated1New15Changed14Fixed34Other1
BreakingUpgrade verdict
4 breaking changes.
In plain terms
- Cops that were moved out of this gem are no longer included here.
- A helper class used by custom cops is gone.
- The RSpec/FilePath check is no longer available.
- The Capybara feature methods check is gone; switch to the Dialect check.
Must act Top 4 of 5 that need code or config changes
rubocop-rspec publishes an official migration guide for version 3. It covers more than the release notes do.
Migration guide ↗What you must change
Breaking4
Removes extracted cops in the Capybara, FactoryBot and Rails departments.
Removes RuboCop::RSpec::Language::NodePattern.
RuboCop::RSpec::Language::NodePatternRemoves the RSpec/FilePath cop.
RSpec/FilePathRemoves the RSpec/Capybara/FeatureMethods cop; use RSpec/Dialect instead.
RSpec/Capybara/FeatureMethodsRSpec/DialectDeprecations to plan for
Deprecated1
Deprecates the
top_level_group? method from the TopLevelGroup mixin since its callers were removed from Rubocop/RSpec.top_level_group?TopLevelGroupRubocop/RSpecAPI changes
Generated by DepDelta from published Ruby source. Not mixed with prose notes.
- removed:
class FilePath < Base - removed:
const Capybara.CurrentPathExpectation - removed:
const Capybara.MatchStyle - removed:
const Capybara.NegationMatcher - removed:
const Capybara.SpecificActions - removed:
const Capybara.SpecificFinders - removed:
const Capybara.SpecificMatcher - removed:
const Capybara.VisibilityMatcher - removed:
const ContextWording.MSG - removed:
const ExpectChange.RESTRICT_ON_SEND - removed:
const FactoryBot.AttributeDefinedStatically - removed:
const FactoryBot.ConsistentParenthesesStyle - removed:
const FactoryBot.CreateList - removed:
const FactoryBot.FactoryClassName - removed:
const FactoryBot.FactoryNameStyle - removed:
const FactoryBot.SyntaxMethods - removed:
const FilePath.MSG - removed:
const IndexedLet.INDEX_REGEX - removed:
const IndexedLet.SUFFIX_INDEX_REGEX - removed:
const MultipleExpectations.TRUE - removed:
const Rails.AvoidSetupHook - removed:
const Rails.HaveHttpStatus - removed:
const Rails.HttpStatus - removed:
const Rails.InferredSpecType - removed:
const Rails.MinitestAssertions - removed:
const Rails.NegationBeValid - removed:
const Rails.TravelAround - removed:
const VerifiedDoubleReference.REFERENCE_TYPE_STYLES - removed:
method ExpectInLet.on_numblock(_) - removed:
method FilePath.on_top_level_example_group(_) - removed:
module Capybara - removed:
module FactoryBot - removed:
module Rails - added:
class DiscardedMatcher < Base - added:
class IncludeExamples < Base - added:
class LeakyLocalVariable < Base - added:
class MatchWithSimpleRegex < Base - added:
class MissingExpectationTargetMethod < Base - added:
class Output < Base - added:
const ContextWording.MSG_ALWAYS - added:
const ContextWording.MSG_MATCH - added:
const DiscardedMatcher.MATCHER_METHODS - added:
const DiscardedMatcher.MSG - added:
const ExpectActual.MSG_NO_ARG - added:
const IncludeExamples.MSG - added:
const IncludeExamples.RESTRICT_ON_SEND - added:
const LeakyLocalVariable.MSG - added:
const MatchWithSimpleRegex.MSG - added:
const MatchWithSimpleRegex.RESTRICT_ON_SEND - added:
const MissingExpectationTargetMethod.MSG - added:
const MissingExpectationTargetMethod.RESTRICT_ON_SEND - added:
const MultipleExpectations.TRUE_NODE - added:
const Output.MSG - added:
const Output.RESTRICT_ON_SEND - added:
const SharedContext.MSG_EXAMPLES_STRICT - added:
const SpecFilePathFormat.PATH_NAME_BOUNDARY - added:
const TopLevelGroup.DEPRECATED_MODULE_METHOD_WARNING - added:
method AroundBlock.on_itblock(_) - added:
method DiscardedMatcher.on_block(_) - added:
method DiscardedMatcher.on_send(_) - added:
method EmptyLineAfterHook.on_itblock(_) - added:
method ExpectInHook.on_itblock(_) - added:
method HookArgument.on_itblock(_) - added:
method HooksBeforeExamples.on_itblock(_) - added:
method IncludeExamples.on_send(_) - added:
method IteratedExpectation.on_itblock(_) - added:
method LeakyLocalVariable.after_leaving_scope(_, _) - added:
method MatchWithSimpleRegex.on_send(_) - added:
method Metadata.on_itblock(_) - added:
method MissingExpectationTargetMethod.on_send(_) - added:
method NoExpectationExample.on_itblock(_) - added:
method Output.on_send(_) - added:
method RedundantAround.on_itblock(_) - added:
method RepeatedItems.add_repeated_lines(_) - added:
method RepeatedItems.find_repeated_groups(_, key_proc:) - added:
method SkipBlockInsideExample.on_itblock(_) - added:
method VerifiedDoubleReference.autocorrect(_, _) - added:
module InsideExample - added:
module RepeatedItems - added:
static method LeakyLocalVariable.joining_forces()
- removed:
class FeatureMethods < Base - removed:
const FeatureMethods.MAP - removed:
const FeatureMethods.MSG - removed:
method FeatureMethods.message(_) - removed:
method FeatureMethods.on_block(_)
- removed:
class NULL_BLOCK_BODY < Struct.new(:loc, :source)
- added:
module ActiveSupportInflector - added:
module DefaultInflector - added:
static method ActiveSupportInflector.call(_) - added:
static method ActiveSupportInflector.prepare_availability(_) - added:
static method DefaultInflector.call(_)
- removed:
const ConfigFormatter.AMENDMENTS - removed:
const ConfigFormatter.EXTRACTED_COPS - removed:
const ConfigFormatter.SUBDEPARTMENTS - removed:
module Inject - removed:
static method Inject.defaults!() - added:
class Plugin < LintRoller::Plugin - added:
method Hook.inside_class_method?() - added:
method Plugin.about() - added:
method Plugin.rules(_) - added:
method Plugin.supported?(_) - added:
module Cop
- added:
class Generator < RuboCop::Cop::Generator - added:
method Generator.todo()
- removed:
method NodePattern.block_or_numblock_pattern(_) - removed:
method NodePattern.block_pattern(_) - removed:
method NodePattern.numblock_pattern(_) - removed:
method NodePattern.send_pattern(_) - removed:
module NodePattern