diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a678a1598..6bf925b9de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# This file was generated on 2022-01-30T10:38:31+00:00 from the rspec-dev repo. +# This file was generated on 2022-09-08T12:41:59+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. name: RSpec CI @@ -11,16 +11,18 @@ on: pull_request: branches: - '*' +permissions: + contents: read env: RSPEC_CI: true # This tells rspec-rails what branch to run in ci - RSPEC_VERSION: '= 3.11.0.pre' + RSPEC_VERSION: '= 3.12.0' jobs: rubocop: name: Rubocop runs-on: 'ubuntu-20.04' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 with: ruby-version: '3.0' @@ -72,7 +74,7 @@ jobs: continue-on-error: ${{ matrix.allow_failure || endsWith(matrix.ruby, 'head') }} env: ${{ matrix.env }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 with: bundler: ${{ matrix.bundler || '2.2.22' }} @@ -117,7 +119,7 @@ jobs: LEGACY_CI: true JRUBY_OPTS: ${{ matrix.container.jruby_opts || '--dev' }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - run: ${{ matrix.container.pre }} - run: script/legacy_setup.sh - run: bundle exec bin/rspec @@ -138,7 +140,7 @@ jobs: - 2.1.9 fail-fast: false steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 with: bundler: '2.2.22' diff --git a/.rubocop.yml b/.rubocop.yml index 9a3abf924a..fa3b63edc3 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,5 +1,6 @@ inherit_from: - .rubocop_rspec_base.yml + - .rubocop_todo.yml AllCops: Exclude: @@ -10,17 +11,20 @@ AllCops: Metrics/ClassLength: Max: 330 -Encoding: - Exclude: - - lib/rspec/core/formatters/exception_presenter.rb +# This can be addressed once Ruby 1.8 support is removed. +Style/Encoding: + Enabled: false # This should go down over time. Metrics/AbcSize: Max: 40 # This should go down over time. -Metrics/LineLength: +Layout/LineLength: Max: 130 + Exclude: + - features/**/* + - spec/**/* # This should go down over time. Metrics/MethodLength: @@ -33,7 +37,7 @@ Metrics/CyclomaticComplexity: Metrics/PerceivedComplexity: Max: 15 -Lint/HandleExceptions: +Lint/SuppressedException: Exclude: - lib/rspec/core/example.rb - lib/rspec/core/mocking_adapters/mocha.rb @@ -89,22 +93,13 @@ Style/RaiseArgs: - lib/rspec/core/hooks.rb - lib/rspec/core/option_parser.rb - lib/rspec/core/pending.rb - -Performance/RedundantBlockCall: - Exclude: - - lib/rspec/core/rake_task.rb + - spec/rspec/core/formatters/base_text_formatter_spec.rb Lint/IneffectiveAccessModifier: Exclude: - lib/rspec/core/memoized_helpers.rb # Fixing this file was too much of a diff -Performance/Caller: - Exclude: - # The suggested fix for this cop only works on more recent rubies. The - # speed up can be substantial (previous optimization work I've done on - # RSpec involved caller optimization) but I haven't benchmarked this - # particular case to see if it's worth introducing version branching. - - 'lib/rspec/core/example_group.rb' - Metrics/BlockLength: - Max: 193 + Max: 206 + Exclude: + - spec/**/*.rb diff --git a/.rubocop_rspec_base.yml b/.rubocop_rspec_base.yml index 1a19dfbff1..1f77f17e6b 100644 --- a/.rubocop_rspec_base.yml +++ b/.rubocop_rspec_base.yml @@ -1,79 +1,76 @@ -# This file was generated on 2022-01-30T10:38:31+00:00 from the rspec-dev repo. +# This file was generated on 2022-09-08T12:41:59+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # This file contains defaults for RSpec projects. Individual projects # can customize by inheriting this file and overriding particular settings. -AccessModifierIndentation: +Layout/AccessModifierIndentation: Enabled: false # "Use alias_method instead of alias" # We're fine with `alias`. -Alias: +Style/Alias: Enabled: false -AlignParameters: - EnforcedStyle: with_first_parameter - # "Avoid the use of the case equality operator ===" # We prefer using `Class#===` over `Object#is_a?` because `Class#===` # is less likely to be monkey patched than `is_a?` on a user object. -CaseEquality: +Style/CaseEquality: Enabled: false # Warns when the class is excessively long. -ClassLength: +Metrics/ClassLength: Max: 100 -CollectionMethods: +Style/CollectionMethods: PreferredMethods: reduce: 'inject' # Over time we'd like to get this down, but this is what we're at now. -CyclomaticComplexity: +Metrics/CyclomaticComplexity: Max: 10 # We use YARD to enforce documentation. It works better than rubocop's # enforcement...rubocop complains about the places we re-open # `RSpec::Expectations` and `RSpec::Matchers` w/o having doc commments. -Documentation: +Style/Documentation: Enabled: false # We still support 1.8.7 which requires trailing dots -DotPosition: +Layout/DotPosition: EnforcedStyle: trailing -DoubleNegation: +Style/DoubleNegation: Enabled: false # each_with_object is unavailable on 1.8.7 so we have to disable this one. -EachWithObject: +Style/EachWithObject: Enabled: false -FormatString: +Style/FormatString: EnforcedStyle: percent # As long as we support ruby 1.8.7 we have to use hash rockets. -HashSyntax: +Style/HashSyntax: EnforcedStyle: hash_rockets # We can't use the new lambda syntax, since we still support 1.8.7. -Lambda: +Style/Lambda: Enabled: false # Over time we'd like to get this down, but this is what we're at now. -LineLength: +Layout/LineLength: Max: 100 # Over time we'd like to get this down, but this is what we're at now. -MethodLength: +Metrics/MethodLength: Max: 15 # Who cares what we call the argument for binary operator methods? -BinaryOperatorParameterName: +Naming/BinaryOperatorParameterName: Enabled: false -PercentLiteralDelimiters: +Style/PercentLiteralDelimiters: PreferredDelimiters: '%': () # double-quoted string '%i': '[]' # array of symbols @@ -87,41 +84,44 @@ PercentLiteralDelimiters: # We have too many special cases where we allow generator methods or prefer a # prefixed predicate due to it's improved readability. -PredicateName: +Naming/PredicateName: Enabled: false # On 1.8 `proc` is `lambda`, so we use `Proc.new` to ensure we get real procs on all supported versions. # http://batsov.com/articles/2014/02/04/the-elements-of-style-in-ruby-number-12-proc-vs-proc-dot-new/ -Proc: +Style/Proc: Enabled: false # Exceptions should be rescued with `Support::AllExceptionsExceptOnesWeMustNotRescue` -RescueException: +Lint/RescueException: Enabled: true # We haven't adopted the `fail` to signal exceptions vs `raise` for re-raises convention. -SignalException: +Style/SignalException: Enabled: false # We've tended to use no space, so it's less of a change to stick with that. -SpaceAroundEqualsInParameterDefault: +Layout/SpaceAroundEqualsInParameterDefault: EnforcedStyle: no_space # We don't care about single vs double qoutes. -StringLiterals: +Style/StringLiterals: Enabled: false # This rule favors constant names from the English standard library which we don't load. Style/SpecialGlobalVars: Enabled: false -Style/TrailingCommaInLiteral: +Style/TrailingCommaInArrayLiteral: + Enabled: false + +Style/TrailingCommaInHashLiteral: Enabled: false Style/TrailingCommaInArguments: Enabled: false -TrivialAccessors: +Style/TrivialAccessors: AllowDSLWriters: true AllowPredicates: true ExactNameMatch: true @@ -135,6 +135,15 @@ Layout/EmptyLineBetweenDefs: Layout/FirstParameterIndentation: Enabled: false +Layout/ParameterAlignment: + EnforcedStyle: with_first_parameter + +Layout/SpaceInsideBlockBraces: + Enabled: false + +Layout/SpaceInsideParens: + Enabled: false + Naming/ConstantName: Enabled: false @@ -162,7 +171,10 @@ Style/IfUnlessModifier: Style/IfUnlessModifierOfIfUnless: Enabled: false -Style/MethodMissing: +Lint/MissingSuper: + Enabled: false + +Style/MissingRespondToMissing: Enabled: false Style/MixinUsage: @@ -243,24 +255,19 @@ Style/StderrPuts: Style/TernaryParentheses: Enabled: false -# This could likely be enabled, but it had a false positive on rspec-mocks -# (suggested change was not behaviour preserving) so I don't trust it. -Performance/HashEachMethods: - Enabled: false - Naming/HeredocDelimiterNaming: Enabled: false -Layout/EmptyLineAfterMagicComment: +Layout/AssignmentIndentation: Enabled: false -Layout/IndentArray: +Layout/EmptyLineAfterMagicComment: Enabled: false -Layout/IndentAssignment: +Layout/FirstArrayElementIndentation: Enabled: false -Layout/IndentHeredoc: +Layout/HeredocIndentation: Enabled: false Layout/SpaceInsidePercentLiteralDelimiters: diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 0000000000..6394a9a412 --- /dev/null +++ b/.rubocop_todo.yml @@ -0,0 +1,1031 @@ +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2022-01-09 17:19:16 UTC using RuboCop version 1.11.0. +# The point is for the user to remove these configuration records +# one by one as the offenses are removed from the code base. +# Note that changes in the inspected code, or installation of new +# versions of RuboCop, may require this file to be generated again. + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include. +# Include: **/*.gemfile, **/Gemfile, **/gems.rb +Bundler/OrderedGems: + Exclude: + - 'Gemfile' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include. +# Include: **/*.gemspec +Gemspec/OrderedDependencies: + Exclude: + - 'rspec-core.gemspec' + +# Offense count: 1 +# Configuration parameters: Include. +# Include: **/*.gemspec +Gemspec/RequiredRubyVersion: + Exclude: + - 'rspec-core.gemspec' + +# Offense count: 20 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: with_first_argument, with_fixed_indentation +Layout/ArgumentAlignment: + Exclude: + - 'benchmarks/threadsafe_let_block.rb' + - 'features/step_definitions/additional_cli_steps.rb' + - 'spec/rspec/core/backtrace_formatter_spec.rb' + - 'spec/rspec/core/configuration_spec.rb' + - 'spec/rspec/core/example_group_spec.rb' + - 'spec/rspec/core/formatters/documentation_formatter_spec.rb' + - 'spec/rspec/core/formatters/exception_presenter_spec.rb' + - 'spec/rspec/core/rake_task_spec.rb' + - 'spec/rspec/core/reporter_spec.rb' + - 'spec/rspec/core_spec.rb' + - 'spec/support/formatter_support.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: with_first_element, with_fixed_indentation +Layout/ArrayAlignment: + Exclude: + - 'spec/rspec/core/filter_manager_spec.rb' + - 'spec/rspec/core/resources/formatter_specs.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyleAlignWith, Severity. +# SupportedStylesAlignWith: start_of_line, begin +Layout/BeginEndAlignment: + Exclude: + - 'lib/rspec/core/runner.rb' + +# Offense count: 6 +# Cop supports --auto-correct. +Layout/BlockEndNewline: + Exclude: + - 'spec/rspec/core/example_group_spec.rb' + - 'spec/rspec/core/metadata_filter_spec.rb' + +# Offense count: 5 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, IndentOneStep, IndentationWidth. +# SupportedStyles: case, end +Layout/CaseIndentation: + Exclude: + - 'spec/support/matchers.rb' + +# Offense count: 9 +# Cop supports --auto-correct. +Layout/ClosingHeredocIndentation: + Exclude: + - 'benchmarks/filter_object.rb' + - 'lib/rspec/core/formatters/html_printer.rb' + - 'lib/rspec/core/memoized_helpers.rb' + - 'lib/rspec/core/option_parser.rb' + - 'spec/rspec/core/notifications_spec.rb' + +# Offense count: 32 +# Cop supports --auto-correct. +Layout/CommentIndentation: + Exclude: + - 'benchmarks/check_inclusion.rb' + +# Offense count: 68 +# Cop supports --auto-correct. +Layout/EmptyLineAfterGuardClause: + Enabled: false + +# Offense count: 3 +# Cop supports --auto-correct. +Layout/EmptyLines: + Exclude: + - 'spec/integration/persistence_failures_spec.rb' + - 'spec/rspec/core/example_group_spec.rb' + - 'spec/rspec/core/example_spec.rb' + +# Offense count: 7 +# Cop supports --auto-correct. +# Configuration parameters: AllowAliasSyntax, AllowedMethods. +# AllowedMethods: alias_method, public, protected, private +Layout/EmptyLinesAroundAttributeAccessor: + Exclude: + - 'lib/rspec/core/configuration.rb' + - 'lib/rspec/core/minitest_assertions_adapter.rb' + - 'spec/rspec/core/bisect/example_minimizer_spec.rb' + - 'spec/rspec/core/formatters/exception_presenter_spec.rb' + - 'spec/rspec/core/resources/custom_example_group_runner.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines +Layout/EmptyLinesAroundModuleBody: + Exclude: + - 'spec/rspec/core/world_spec.rb' + - 'spec/support/formatter_support.rb' + +# Offense count: 21 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: consistent, consistent_relative_to_receiver, special_for_inner_method_call, special_for_inner_method_call_in_parentheses +Layout/FirstArgumentIndentation: + Exclude: + - 'lib/rspec/core/bisect/fork_runner.rb' + - 'lib/rspec/core/formatters/base_bisect_formatter.rb' + - 'spec/integration/bisect_runners_spec.rb' + - 'spec/rspec/core/bisect/coordinator_spec.rb' + - 'spec/rspec/core/bisect/example_minimizer_spec.rb' + - 'spec/rspec/core/bisect/server_spec.rb' + - 'spec/rspec/core/bisect/shell_command_spec.rb' + - 'spec/rspec/core/bisect/utilities_spec.rb' + - 'spec/rspec/core/configuration_options_spec.rb' + - 'spec/rspec/core/configuration_spec.rb' + - 'spec/rspec/core/formatters/base_text_formatter_spec.rb' + - 'spec/rspec/core/hooks_spec.rb' + - 'spec/rspec/core/notifications_spec.rb' + - 'spec/rspec/core/shared_example_group_spec.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: IndentationWidth. +# SupportedStyles: special_inside_parentheses, consistent, align_braces +Layout/FirstHashElementIndentation: + EnforcedStyle: consistent + +# Offense count: 65 +# Cop supports --auto-correct. +# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle. +# SupportedHashRocketStyles: key, separator, table +# SupportedColonStyles: key, separator, table +# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit +Layout/HashAlignment: + Enabled: false + +# Offense count: 3 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: normal, indented_internal_methods +Layout/IndentationConsistency: + Exclude: + - 'spec/rspec/core/metadata_filter_spec.rb' + - 'spec/support/aruba_support.rb' + +# Offense count: 9 +# Cop supports --auto-correct. +# Configuration parameters: Width, IgnoredPatterns. +Layout/IndentationWidth: + Exclude: + - 'benchmarks/respond_to_v_defined.rb' + - 'spec/rspec/core/example_group_spec.rb' + - 'spec/rspec/core_spec.rb' + - 'spec/support/aruba_support.rb' + - 'spec/support/formatter_support.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment. +Layout/LeadingCommentSpace: + Exclude: + - 'spec/rspec/core/formatters/progress_formatter_spec.rb' + - 'spec/rspec/core/metadata_spec.rb' + +# Offense count: 68 +# Cop supports --auto-correct. +# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. +# URISchemes: http, https +Layout/LineLength: + Max: 172 + +# Offense count: 8 +# Cop supports --auto-correct. +Layout/MultilineBlockLayout: + Exclude: + - 'spec/rspec/core/example_group_spec.rb' + - 'spec/rspec/core/metadata_filter_spec.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +Layout/RescueEnsureAlignment: + Exclude: + - 'lib/rspec/core/runner.rb' + +# Offense count: 49 +# Cop supports --auto-correct. +Layout/SpaceAfterComma: + Exclude: + - 'spec/rspec/core/backtrace_formatter_spec.rb' + - 'spec/rspec/core/configuration_options_spec.rb' + - 'spec/rspec/core/configuration_spec.rb' + - 'spec/rspec/core/drb_spec.rb' + - 'spec/rspec/core/example_group_spec.rb' + - 'spec/rspec/core/filter_manager_spec.rb' + - 'spec/rspec/core/memoized_helpers_spec.rb' + - 'spec/rspec/core/metadata_filter_spec.rb' + - 'spec/rspec/core/option_parser_spec.rb' + +# Offense count: 12 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: space, no_space +Layout/SpaceAroundEqualsInParameterDefault: + Exclude: + - 'benchmarks/singleton_example_groups/helper.rb' + - 'spec/rspec/core/bisect/coordinator_spec.rb' + - 'spec/rspec/core/example_group_spec.rb' + - 'spec/rspec/core/example_status_persister_spec.rb' + - 'spec/rspec/core/formatters/exception_presenter_spec.rb' + - 'spec/support/formatter_support.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +Layout/SpaceAroundKeyword: + Exclude: + - 'spec/rspec/core/configuration_spec.rb' + - 'spec/rspec/core/memoized_helpers_spec.rb' + +# Offense count: 24 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: space, no_space +# SupportedStylesForEmptyBraces: space, no_space +Layout/SpaceBeforeBlockBraces: + Enabled: false + +# Offense count: 3 +# Cop supports --auto-correct. +# Configuration parameters: AllowForAlignment. +Layout/SpaceBeforeFirstArg: + Exclude: + - 'spec/rspec/core/drb_spec.rb' + +# Offense count: 58 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBrackets. +# SupportedStyles: space, no_space, compact +# SupportedStylesForEmptyBrackets: space, no_space +Layout/SpaceInsideArrayLiteralBrackets: + Exclude: + - 'spec/rspec/core/bisect/shell_command_spec.rb' + - 'spec/rspec/core/configuration_options_spec.rb' + - 'spec/rspec/core/configuration_spec.rb' + - 'spec/rspec/core/example_group_spec.rb' + - 'spec/rspec/core/example_status_persister_spec.rb' + - 'spec/rspec/core/formatters/exception_presenter_spec.rb' + - 'spec/rspec/core/formatters/snippet_extractor_spec.rb' + - 'spec/rspec/core/metadata_spec.rb' + - 'spec/rspec/core/notifications_spec.rb' + - 'spec/rspec/core/shared_example_group_spec.rb' + - 'spec/rspec/core/suite_hooks_spec.rb' + +# Offense count: 81 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces. +# SupportedStyles: space, no_space, compact +# SupportedStylesForEmptyBraces: space, no_space +Layout/SpaceInsideHashLiteralBraces: + Exclude: + - 'spec/rspec/core/configuration_spec.rb' + - 'spec/rspec/core/drb_spec.rb' + - 'spec/rspec/core/filter_manager_spec.rb' + - 'spec/rspec/core/hooks_spec.rb' + - 'spec/rspec/core/memoized_helpers_spec.rb' + - 'spec/rspec/core/metadata_filter_spec.rb' + - 'spec/rspec/core/runner_spec.rb' + - 'spec/rspec/core/shared_example_group_spec.rb' + +# Offense count: 5 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: final_newline, final_blank_line +Layout/TrailingEmptyLines: + Exclude: + - 'benchmarks/eager_vs_lazy_metadata/define_examples.rb' + - 'features/support/send_sigint_during_bisect.rb' + - 'spec/rspec/core/memoized_helpers_spec.rb' + - 'spec/rspec/core/rspec_matchers_spec.rb' + - 'spec/rspec/core_spec.rb' + +# Offense count: 16 +Lint/AmbiguousBlockAssociation: + Exclude: + - 'benchmarks/threadsafe_let_block.rb' + - 'spec/rspec/core/example_group_spec.rb' + - 'spec/rspec/core/example_spec.rb' + - 'spec/rspec/core/formatters/exception_presenter_spec.rb' + - 'spec/rspec/core/formatters/syntax_highlighter_spec.rb' + - 'spec/rspec/core/formatters_spec.rb' + - 'spec/rspec/core/memoized_helpers_spec.rb' + - 'spec/rspec/core/option_parser_spec.rb' + - 'spec/rspec/core/world_spec.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Lint/AmbiguousOperator: + Exclude: + - 'benchmarks/threadsafe_let_block.rb' + +# Offense count: 15 +# Cop supports --auto-correct. +Lint/AmbiguousRegexpLiteral: + Exclude: + - 'features/step_definitions/additional_cli_steps.rb' + +# Offense count: 2 +# Configuration parameters: AllowSafeAssignment. +Lint/AssignmentInCondition: + Exclude: + - 'benchmarks/index_v_take_while.rb' + - 'spec/rspec/core/metadata_spec.rb' + +# Offense count: 2 +Lint/BinaryOperatorWithIdenticalOperands: + Exclude: + - 'spec/rspec/core/example_spec.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +Lint/BooleanSymbol: + Exclude: + - 'spec/rspec/core/example_group_spec.rb' + +# Offense count: 13 +# Configuration parameters: AllowedMethods. +# AllowedMethods: enums +Lint/ConstantDefinitionInBlock: + Exclude: + - 'spec/integration/bisect_spec.rb' + - 'spec/rspec/core/bisect/example_minimizer_spec.rb' + - 'spec/rspec/core/bisect/utilities_spec.rb' + - 'spec/rspec/core/configuration_spec.rb' + - 'spec/rspec/core/drb_spec.rb' + - 'spec/rspec/core/filterable_item_repository_spec.rb' + - 'spec/rspec/core/formatters/exception_presenter_spec.rb' + - 'spec/rspec/core/hooks_spec.rb' + - 'spec/rspec/core/shared_example_group_spec.rb' + +# Offense count: 1 +Lint/DuplicateRequire: + Exclude: + - 'benchmarks/hash_functions.rb' + +# Offense count: 10 +# Configuration parameters: AllowComments. +Lint/EmptyFile: + Exclude: + - 'spec/rspec/core/resources/a_bar.rb' + - 'spec/rspec/core/resources/a_foo.rb' + - 'spec/rspec/core/resources/acceptance/bar.rb' + - 'spec/rspec/core/resources/acceptance/foo_spec.rb' + - 'spec/support/fake_libs/coderay.rb' + - 'spec/support/fake_libs/drb/acl.rb' + - 'spec/support/fake_libs/drb/drb.rb' + - 'spec/support/fake_libs/json.rb' + - 'spec/support/fake_libs/minitest.rb' + - 'spec/support/fake_libs/rake.rb' + +# Offense count: 2 +Lint/FloatComparison: + Exclude: + - 'features/support/ruby_27_support.rb' + - 'lib/rspec/core/formatters/helpers.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: runtime_error, standard_error +Lint/InheritException: + Exclude: + - 'spec/rspec/core/formatters/exception_presenter_spec.rb' + - 'spec/support/fake_libs/rspec/expectations.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +Lint/InterpolationCheck: + Exclude: + - 'spec/rspec/core/bisect/shell_command_spec.rb' + - 'spec/rspec/core/rake_task_spec.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +Lint/RedundantCopDisableDirective: + Exclude: + - 'lib/rspec/core/formatters/html_snippet_extractor.rb' + - 'lib/rspec/core/formatters/syntax_highlighter.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +Lint/RedundantCopEnableDirective: + Exclude: + - 'lib/rspec/core/formatters/html_printer.rb' + - 'lib/rspec/core/formatters/html_snippet_extractor.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Lint/RedundantStringCoercion: + Exclude: + - 'spec/spec_helper.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Lint/SendWithMixinArgument: + Exclude: + - 'lib/rspec/core/configuration.rb' + +# Offense count: 1 +Lint/ShadowingOuterLocalVariable: + Exclude: + - 'benchmarks/hash_functions.rb' + +# Offense count: 1 +Lint/StructNewOverride: + Exclude: + - 'lib/rspec/core/notifications.rb' + +# Offense count: 1 +# Configuration parameters: AllowComments. +Lint/SuppressedException: + Exclude: + - 'lib/rspec/core/example.rb' + - 'lib/rspec/core/mocking_adapters/mocha.rb' + - 'lib/rspec/core/runner.rb' + - 'lib/rspec/core/test_unit_assertions_adapter.rb' + - 'script/rspec_with_simplecov' + +# Offense count: 25 +# Cop supports --auto-correct. +# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments. +Lint/UnusedBlockArgument: + Exclude: + - 'features/support/env.rb' + - 'features/support/jruby.rb' + - 'features/support/rubinius.rb' + - 'spec/rspec/core/example_group_spec.rb' + - 'spec/rspec/core/formatters/exception_presenter_spec.rb' + - 'spec/rspec/core/formatters/json_formatter_spec.rb' + - 'spec/rspec/core/invocations_spec.rb' + - 'spec/rspec/core/memoized_helpers_spec.rb' + - 'spec/rspec/core/metadata_filter_spec.rb' + - 'spec/rspec/core/metadata_spec.rb' + - 'spec/rspec/core/notifications_spec.rb' + - 'spec/rspec/core/rake_task_spec.rb' + - 'spec/rspec/core/reporter_spec.rb' + - 'spec/support/formatter_support.rb' + +# Offense count: 3 +# Cop supports --auto-correct. +# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods. +Lint/UnusedMethodArgument: + Exclude: + - 'benchmarks/capture_block_vs_yield.rb' + - 'spec/integration/filtering_spec.rb' + - 'spec/rspec/core/formatters/snippet_extractor_spec.rb' + +# Offense count: 1 +Lint/UselessAssignment: + Exclude: + - 'benchmarks/hash_functions.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: AllowComments. +Lint/UselessMethodDefinition: + Exclude: + - 'spec/rspec/core/rspec_matchers_spec.rb' + +# Offense count: 4 +# Configuration parameters: CheckForMethodsWithNoSideEffects. +Lint/Void: + Exclude: + - 'benchmarks/keys_each_vs_each_key.rb' + - 'spec/rspec/core/example_group_spec.rb' + +# Offense count: 1 +# Configuration parameters: IgnoredMethods, CountRepeatedAttributes. +Metrics/AbcSize: + Max: 283 + +# Offense count: 32 +# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods. +# IgnoredMethods: refine +Metrics/BlockLength: + Max: 2373 + +# Offense count: 1 +# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods. +Metrics/MethodLength: + Max: 134 + +# Offense count: 32 +# Configuration parameters: CountComments, CountAsOne. +Metrics/ModuleLength: + Max: 2351 + +# Offense count: 1 +# Configuration parameters: CountKeywordArgs, MaxOptionalParameters. +Metrics/ParameterLists: + Max: 6 + +# Offense count: 4 +# Configuration parameters: AsciiConstants. +Naming/AsciiIdentifiers: + Exclude: + - 'spec/rspec/core/resources/utf8_encoded.rb' + +# Offense count: 6 +# Configuration parameters: EnforcedStyleForLeadingUnderscores. +# SupportedStylesForLeadingUnderscores: disallowed, required, optional +Naming/MemoizedInstanceVariableName: + Exclude: + - 'lib/rspec/core/example_group.rb' + - 'lib/rspec/core/example_status_persister.rb' + - 'lib/rspec/core/notifications.rb' + - 'lib/rspec/core/ruby_project.rb' + - 'spec/rspec/core/configuration_spec.rb' + - 'spec/support/formatter_support.rb' + +# Offense count: 1 +# Configuration parameters: IgnoredPatterns. +# SupportedStyles: snake_case, camelCase +Naming/MethodName: + EnforcedStyle: snake_case + Exclude: + - 'spec/rspec/core/drb_spec.rb' + +# Offense count: 14 +# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. +# AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to +Naming/MethodParameterName: + Exclude: + - 'benchmarks/capture_block_vs_yield.rb' + - 'lib/rspec/core/example.rb' + - 'lib/rspec/core/formatters/exception_presenter.rb' + - 'spec/rspec/core/example_status_persister_spec.rb' + - 'spec/rspec/core/formatters/exception_presenter_spec.rb' + - 'spec/rspec/core/hooks_spec.rb' + - 'spec/rspec/core/memoized_helpers_spec.rb' + - 'spec/rspec/core/ordering_spec.rb' + - 'spec/support/formatter_support.rb' + - 'spec/support/helper_methods.rb' + +# Offense count: 13 +# Cop supports --auto-correct. +# Configuration parameters: PreferredName. +Naming/RescuedExceptionsVariableName: + Exclude: + - 'lib/rspec/core/configuration.rb' + - 'lib/rspec/core/example.rb' + - 'lib/rspec/core/example_group.rb' + - 'lib/rspec/core/formatters/exception_presenter.rb' + - 'lib/rspec/core/hooks.rb' + - 'spec/rspec/core/formatters/exception_presenter_spec.rb' + - 'spec/rspec/core/formatters/snippet_extractor_spec.rb' + - 'spec/rspec/core/notifications_spec.rb' + +# Offense count: 1 +Security/Eval: + Exclude: + - 'Gemfile' + +# Offense count: 7 +# Configuration parameters: EnforcedStyle, AllowModifiersOnSymbols. +# SupportedStyles: inline, group +Style/AccessModifierDeclarations: + Exclude: + - 'lib/rspec/core/flat_map.rb' + - 'lib/rspec/core/ruby_project.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: separated, grouped +Style/AccessorGrouping: + Exclude: + - 'spec/rspec/core/bisect/example_minimizer_spec.rb' + +# Offense count: 1 +# Configuration parameters: AllowedChars. +# AllowedChars: © +Style/AsciiComments: + Exclude: + - 'spec/rspec/core/formatters/exception_presenter_spec.rb' + +# Offense count: 4 +# Cop supports --auto-correct. +Style/CaseLikeIf: + Exclude: + - 'lib/rspec/core/hooks.rb' + - 'lib/rspec/core/option_parser.rb' + - 'spec/rspec/core/bisect/shell_runner_spec.rb' + +# Offense count: 43 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: nested, compact +Style/ClassAndModuleChildren: + Enabled: false + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: IgnoredMethods. +# IgnoredMethods: ==, equal?, eql? +Style/ClassEqualityComparison: + Exclude: + - 'lib/rspec/core/formatters.rb' + +# Offense count: 1 +Style/ClassVars: + Exclude: + - 'benchmarks/singleton_example_groups/helper.rb' + +# Offense count: 7 +# Cop supports --auto-correct. +Style/ColonMethodCall: + Exclude: + - 'spec/rspec/core/drb_spec.rb' + - 'spec/rspec/core/formatters/base_text_formatter_spec.rb' + - 'spec/rspec/core/shared_example_group_spec.rb' + - 'spec/rspec/core_spec.rb' + +# Offense count: 3 +Style/CombinableLoops: + Exclude: + - 'benchmarks/singleton_example_groups/helper.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: Keywords. +# Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE +Style/CommentAnnotation: + Exclude: + - 'lib/rspec/core/shell_escape.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +Style/Dir: + Exclude: + - 'spec/support/spec_files.rb' + +# Offense count: 7 +# Cop supports --auto-correct. +Style/Encoding: + Exclude: + - 'lib/rspec/core/formatters/exception_presenter.rb' + - 'rspec-core.gemspec' + - 'spec/rspec/core/example_group_constants_spec.rb' + - 'spec/rspec/core/example_group_spec.rb' + - 'spec/rspec/core/formatters/base_text_formatter_spec.rb' + - 'spec/rspec/core/formatters/exception_presenter_spec.rb' + - 'spec/rspec/core/formatters/html_formatter_spec.rb' + - 'spec/rspec/core/resources/utf8_encoded.rb' + +# Offense count: 21 +# Cop supports --auto-correct. +Style/EvalWithLocation: + Exclude: + - 'benchmarks/call_v_yield.rb' + - 'spec/rspec/core/filter_manager_spec.rb' + - 'spec/rspec/core/formatters/base_text_formatter_spec.rb' + - 'spec/rspec/core/metadata_spec.rb' + - 'spec/rspec/core/world_spec.rb' + +# Offense count: 13 +# Cop supports --auto-correct. +Style/ExpandPathArguments: + Exclude: + - 'Gemfile' + - 'benchmarks/allocations/helper.rb' + - 'features/step_definitions/additional_cli_steps.rb' + - 'lib/rspec/core.rb' + - 'lib/rspec/core/project_initializer.rb' + - 'lib/rspec/core/rake_task.rb' + - 'rspec-core.gemspec' + - 'script/rspec_with_simplecov' + - 'spec/rspec/core/configuration_spec.rb' + - 'spec/rspec/core/rake_task_spec.rb' + - 'spec/rspec/core_spec.rb' + +# Offense count: 16 +# Cop supports --auto-correct. +Style/ExplicitBlockArgument: + Exclude: + - 'benchmarks/allocations/helper.rb' + - 'benchmarks/capture_block_vs_yield.rb' + - 'benchmarks/flat_map_vs_inject.rb' + - 'benchmarks/map_then_flatten_vs_flat_map_benchmarks.rb' + - 'benchmarks/several_regexps_v_one_big_one.rb' + - 'benchmarks/to_proc_v_not_to_proc.rb' + - 'lib/rspec/core/configuration.rb' + - 'lib/rspec/core/example.rb' + - 'lib/rspec/core/hooks.rb' + - 'lib/rspec/core/ordering.rb' + - 'spec/rspec/core/configuration/only_failures_support_spec.rb' + - 'spec/rspec/core/drb_spec.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: left_coerce, right_coerce, single_coerce, fdiv +Style/FloatDivision: + Exclude: + - 'lib/rspec/core/formatters/html_formatter.rb' + +# Offense count: 224 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: always, always_true, never +Style/FrozenStringLiteralComment: + Enabled: false + +# Offense count: 1 +# Cop supports --auto-correct. +Style/GlobalStdStream: + Exclude: + - 'spec/rspec/core/configuration_spec.rb' + +# Offense count: 20 +# Configuration parameters: AllowedVariables. +Style/GlobalVars: + Exclude: + - 'benchmarks/map_then_flatten_vs_flat_map_benchmarks.rb' + - 'benchmarks/several_regexps_v_one_big_one.rb' + - 'benchmarks/shuffle_vs_sort_by_for_random_ordering.rb' + - 'benchmarks/to_proc_v_not_to_proc.rb' + - 'spec/rspec/core/configuration_spec.rb' + - 'spec/rspec/core/formatters/base_text_formatter_spec.rb' + - 'spec/rspec/core/metadata_spec.rb' + - 'spec/spec_helper.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +Style/HashEachMethods: + Exclude: + - 'benchmarks/keys_each_vs_each_key.rb' + +# Offense count: 16 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. +# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys +Style/HashSyntax: + Exclude: + - 'benchmarks/allocations/helper.rb' + - 'benchmarks/allocations/running_1000_groups_1_example.rb' + - 'benchmarks/allocations/running_1_group_1000_examples.rb' + - 'benchmarks/singleton_example_groups/helper.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: InverseMethods, InverseBlocks. +Style/InverseMethods: + Exclude: + - 'spec/spec_helper.rb' + +# Offense count: 9 +# Cop supports --auto-correct. +Style/LineEndConcatenation: + Exclude: + - 'spec/rspec/core/formatters/base_text_formatter_spec.rb' + - 'spec/rspec/core/option_parser_spec.rb' + +# Offense count: 37 +# Cop supports --auto-correct. +# Configuration parameters: IgnoredMethods. +Style/MethodCallWithoutArgsParentheses: + Exclude: + - 'spec/rspec/core/configuration_options_spec.rb' + - 'spec/rspec/core/configuration_spec.rb' + - 'spec/rspec/core/example_group_spec.rb' + - 'spec/rspec/core/formatters/base_text_formatter_spec.rb' + - 'spec/rspec/core/metadata_spec.rb' + +# Offense count: 5 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: require_parentheses, require_no_parentheses, require_no_parentheses_except_multiline +Style/MethodDefParentheses: + Exclude: + - 'spec/rspec/core/example_group_spec.rb' + - 'spec/rspec/core/formatters/json_formatter_spec.rb' + - 'spec/rspec/core/formatters/profile_formatter_spec.rb' + - 'spec/support/formatter_support.rb' + +# Offense count: 1 +Style/MultilineBlockChain: + Exclude: + - 'spec/rspec/core/invocations_spec.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: both, prefix, postfix +Style/NegatedIf: + Exclude: + - 'features/step_definitions/additional_cli_steps.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedOctalStyle. +# SupportedOctalStyles: zero_with_o, zero_only +Style/NumericLiteralPrefix: + Exclude: + - 'spec/integration/persistence_failures_spec.rb' + +# Offense count: 8 +# Cop supports --auto-correct. +# Configuration parameters: Strict. +Style/NumericLiterals: + MinDigits: 11 + +# Offense count: 7 +# Configuration parameters: AllowedMethods. +# AllowedMethods: respond_to_missing? +Style/OptionalBooleanParameter: + Exclude: + - 'lib/rspec/core/formatters/bisect_progress_formatter.rb' + - 'lib/rspec/core/metadata.rb' + - 'lib/rspec/core/option_parser.rb' + - 'lib/rspec/core/output_wrapper.rb' + - 'lib/rspec/core/runner.rb' + - 'spec/rspec/core/example_group_spec.rb' + - 'spec/support/formatter_support.rb' + +# Offense count: 33 +# Cop supports --auto-correct. +# Configuration parameters: PreferredDelimiters. +Style/PercentLiteralDelimiters: + Exclude: + - 'benchmarks/filter_object.rb' + - 'benchmarks/several_regexps_v_one_big_one.rb' + - 'features/step_definitions/additional_cli_steps.rb' + - 'spec/rspec/core/drb_spec.rb' + - 'spec/rspec/core/example_group_spec.rb' + - 'spec/rspec/core/memoized_helpers_spec.rb' + - 'spec/rspec/core/rake_task_spec.rb' + +# Offense count: 5 +# Cop supports --auto-correct. +Style/PerlBackrefs: + Exclude: + - 'features/step_definitions/additional_cli_steps.rb' + - 'spec/spec_helper.rb' + - 'spec/support/aruba_support.rb' + - 'spec/support/formatter_support.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +Style/RandomWithOffset: + Exclude: + - 'spec/integration/spec_file_load_errors_spec.rb' + - 'spec/integration/suite_hooks_errors_spec.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Style/RedundantAssignment: + Exclude: + - 'spec/rspec/core/resources/utf8_encoded.rb' + +# Offense count: 3 +# Cop supports --auto-correct. +Style/RedundantCapitalW: + Exclude: + - 'spec/integration/bisect_spec.rb' + - 'spec/rspec/core/bisect/shell_command_spec.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: SafeForConstants. +Style/RedundantFetchBlock: + Exclude: + - 'spec/rspec/core/example_execution_result_spec.rb' + - 'spec/rspec/core/ordering_spec.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Style/RedundantInterpolation: + Exclude: + - 'spec/rspec/core/formatters/base_text_formatter_spec.rb' + +# Offense count: 23 +# Cop supports --auto-correct. +Style/RedundantPercentQ: + Exclude: + - 'benchmarks/filter_object.rb' + - 'features/step_definitions/additional_cli_steps.rb' + - 'spec/rspec/core/example_group_spec.rb' + - 'spec/support/spec_files.rb' + +# Offense count: 11 +# Cop supports --auto-correct. +Style/RedundantRegexpEscape: + Exclude: + - 'features/step_definitions/additional_cli_steps.rb' + - 'lib/rspec/core/configuration.rb' + - 'spec/rspec/core/formatters/base_text_formatter_spec.rb' + - 'spec/rspec/core/formatters/profile_formatter_spec.rb' + - 'spec/rspec/core/notifications_spec.rb' + +# Offense count: 11 +# Cop supports --auto-correct. +Style/RedundantSelf: + Exclude: + - 'spec/rspec/core/configuration_spec.rb' + - 'spec/rspec/core/example_group_spec.rb' + - 'spec/rspec/core/memoized_helpers_spec.rb' + +# Offense count: 3 +# Cop supports --auto-correct. +Style/RescueModifier: + Exclude: + - 'spec/rspec/core/memoized_helpers_spec.rb' + - 'spec/rspec/core/reporter_spec.rb' + +# Offense count: 7 +# Cop supports --auto-correct. +# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods. +# AllowedMethods: present?, blank?, presence, try, try! +Style/SafeNavigation: + Exclude: + - 'lib/rspec/core/configuration_options.rb' + - 'lib/rspec/core/drb.rb' + - 'lib/rspec/core/example.rb' + - 'lib/rspec/core/rake_task.rb' + - 'lib/rspec/core/runner.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Style/SelfAssignment: + Exclude: + - 'spec/rspec/core/hooks_spec.rb' + +# Offense count: 59 +# Cop supports --auto-correct. +# Configuration parameters: AllowAsExpressionSeparator. +Style/Semicolon: + Exclude: + - 'benchmarks/keys_each_vs_each_key.rb' + - 'benchmarks/threadsafe_let_block.rb' + - 'spec/rspec/core/aggregate_failures_spec.rb' + - 'spec/rspec/core/example_group_spec.rb' + - 'spec/rspec/core/example_spec.rb' + - 'spec/rspec/core/filter_manager_spec.rb' + - 'spec/rspec/core/formatters/json_formatter_spec.rb' + - 'spec/rspec/core/hooks_filtering_spec.rb' + - 'spec/rspec/core/hooks_spec.rb' + - 'spec/rspec/core/memoized_helpers_spec.rb' + +# Offense count: 16 +# Cop supports --auto-correct. +# Configuration parameters: AllowIfMethodIsEmpty. +Style/SingleLineMethods: + Exclude: + - 'spec/rspec/core/configuration_spec.rb' + - 'spec/rspec/core/example_group_spec.rb' + - 'spec/rspec/core/memoized_helpers_spec.rb' + - 'spec/rspec/core/shared_example_group_spec.rb' + - 'spec/support/fake_libs/rspec/expectations.rb' + - 'spec/support/fake_libs/rspec/mocks.rb' + +# Offense count: 42 +# Cop supports --auto-correct. +Style/StringConcatenation: + Exclude: + - 'features/step_definitions/additional_cli_steps.rb' + - 'features/step_definitions/core_standalone_steps.rb' + - 'lib/rspec/core/bisect/utilities.rb' + - 'lib/rspec/core/did_you_mean.rb' + - 'lib/rspec/core/example_group.rb' + - 'lib/rspec/core/notifications.rb' + - 'lib/rspec/core/option_parser.rb' + - 'script/console' + - 'spec/rspec/core/configuration_spec.rb' + - 'spec/rspec/core/did_you_mean_spec.rb' + - 'spec/rspec/core/formatters/base_text_formatter_spec.rb' + - 'spec/rspec/core/memoized_helpers_spec.rb' + - 'spec/rspec/core/option_parser_spec.rb' + - 'spec/support/spec_files.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, IgnoreClassMethods, AllowedMethods. +# AllowedMethods: to_ary, to_a, to_c, to_enum, to_h, to_hash, to_i, to_int, to_io, to_open, to_path, to_proc, to_r, to_regexp, to_str, to_s, to_sym +Style/TrivialAccessors: + Exclude: + - 'benchmarks/define_method_v_attr_reader_v_def.rb' + +# Offense count: 9 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, MinSize, WordRegex. +# SupportedStyles: percent, brackets +Style/WordArray: + Exclude: + - 'spec/integration/order_spec.rb' + - 'spec/rspec/core/configuration_options_spec.rb' + - 'spec/rspec/core/configuration_spec.rb' + - 'spec/rspec/core/example_group_spec.rb' + - 'spec/rspec/core/formatters/snippet_extractor_spec.rb' + - 'spec/rspec/core/memoized_helpers_spec.rb' + - 'spec/rspec/core/shared_context_spec.rb' diff --git a/Changelog.md b/Changelog.md index 69c725a3f2..16051a8188 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,10 @@ ### Development -[Full Changelog](http://github.com/rspec/rspec-core/compare/v3.11.0...main) +[Full Changelog](http://github.com/rspec/rspec-core/compare/v3.12.0...3-12-maintenance) + +### 3.12.0 / 2022-10-26 +[Full Changelog](http://github.com/rspec/rspec-core/compare/v3.11.0...v3.12.0) + +* No changes, released to support other gems. ### 3.11.0 / 2022-02-09 [Full Changelog](http://github.com/rspec/rspec-core/compare/v3.10.2...v3.11.0) diff --git a/Gemfile b/Gemfile index 9e95b7753d..521807c5d1 100644 --- a/Gemfile +++ b/Gemfile @@ -16,8 +16,10 @@ if RUBY_VERSION < '1.9.3' gem 'rake', '< 11.0.0' # rake 11 requires Ruby 1.9.3 or later elsif RUBY_VERSION < '2.0.0' gem 'rake', '< 12.0.0' # rake 12 requires Ruby 2.0.0 or later +elsif RUBY_VERSION < '2.2.0' + gem 'rake', '< 13.0.0' # rake 13 requires Ruby 2.2.0 or later else - gem 'rake', '>= 12.3.3' + gem 'rake', '>= 13.0.0' end if ENV['DIFF_LCS_VERSION'] @@ -47,6 +49,8 @@ end if RUBY_VERSION < '2.2.0' && !!(RbConfig::CONFIG['host_os'] =~ /cygwin|mswin|mingw|bccwin|wince|emx/) gem 'ffi', '< 1.10' +elsif RUBY_VERSION < '2.4.0' && !!(RbConfig::CONFIG['host_os'] =~ /cygwin|mswin|mingw|bccwin|wince|emx/) + gem 'ffi', '< 1.15' elsif RUBY_VERSION < '2.0' gem 'ffi', '< 1.9.19' # ffi dropped Ruby 1.8 support in 1.9.19 elsif RUBY_VERSION < '2.3.0' @@ -59,8 +63,10 @@ if RUBY_VERSION < '2.3.0' && !!(RbConfig::CONFIG['host_os'] =~ /cygwin|mswin|min gem "childprocess", "< 1.0.0" elsif RUBY_VERSION < '2.0.0' gem "childprocess", "< 1.0.0" +elsif RUBY_VERSION < '2.3.0' + gem "childprocess", "< 3.0.0" else - gem "childprocess", "> 1.0.0" + gem "childprocess", ">= 3.0.0" end platforms :jruby do @@ -78,7 +84,7 @@ end # No need to run rubocop on earlier versions if RUBY_VERSION >= '2.4' && RUBY_ENGINE == 'ruby' - gem "rubocop", "~> 0.52.1" + gem "rubocop", "~> 1.0", "< 1.12" end gem 'test-unit', '~> 3.0' if RUBY_VERSION.to_f >= 2.2 @@ -88,6 +94,10 @@ if RUBY_VERSION < '2.4.0' gem 'minitest', '< 5.12.0' end +if RUBY_VERSION < '2.0.0' + gem 'cucumber', "<= 1.3.22" +end + gem 'contracts', '< 0.16' if RUBY_VERSION < '1.9.0' eval File.read('Gemfile-custom') if File.exist?('Gemfile-custom') diff --git a/benchmarks/singleton_example_groups/helper.rb b/benchmarks/singleton_example_groups/helper.rb index 8f543c1e25..7e93e18d18 100644 --- a/benchmarks/singleton_example_groups/helper.rb +++ b/benchmarks/singleton_example_groups/helper.rb @@ -34,8 +34,10 @@ def old_configure_example(*) class BenchmarkHelpers def self.prepare_implementation(prefix) RSpec.world = RSpec::Core::World.new # clear our state - RSpec::Core::Example.__send__ :alias_method, :with_around_and_singleton_context_hooks, :"#{prefix}_with_around_and_singleton_context_hooks" - RSpec::Core::Hooks::HookCollections.__send__ :alias_method, :register_global_singleton_context_hooks, :"#{prefix}_register_global_singleton_context_hooks" + RSpec::Core::Example.__send__ :alias_method, :with_around_and_singleton_context_hooks, + :"#{prefix}_with_around_and_singleton_context_hooks" + RSpec::Core::Hooks::HookCollections.__send__ :alias_method, :register_global_singleton_context_hooks, + :"#{prefix}_register_global_singleton_context_hooks" RSpec::Core::Configuration.__send__ :alias_method, :configure_example, :"#{prefix}_configure_example" end diff --git a/cucumber.yml b/cucumber.yml index e37a8bcc15..fd434e1e93 100644 --- a/cucumber.yml +++ b/cucumber.yml @@ -1,6 +1,11 @@ <% + +USE_TILDE_TAGS = !defined?(::RUBY_ENGINE_VERSION) || (::RUBY_ENGINE_VERSION < '2.0.0') +NOT_WIP_TAG = USE_TILDE_TAGS ? '~@wip' : '"not @wip"' +NOT_JRUBY_TAG = USE_TILDE_TAGS ? '~@no-jruby' : '"not @no-jruby"' + exclusions = [] -exclusions << ' --tags ~@no-jruby' if RUBY_PLATFORM == 'java' +exclusions << " --tags #{NOT_JRUBY_TAG}" if RUBY_PLATFORM == 'java' %> -default: --require features --strict --format progress --tags ~@wip<%= exclusions.join %> features +default: --require features --strict --format progress --tags <%= NOT_WIP_TAG %><%= exclusions.join %> features wip: --require features --tags @wip:30 --wip features diff --git a/features/command_line/init.feature b/features/command_line/init.feature index 74ea6c5409..92c5defb27 100644 --- a/features/command_line/init.feature +++ b/features/command_line/init.feature @@ -25,7 +25,7 @@ Feature: `--init` option Scenario: Accept and use the recommended settings in `spec_helper` (which are initially commented out) Given I have a brand new project with no files And I have run `rspec --init` - When I accept the recommended settings by removing `=begin` and `=end` from `spec/spec_helper.rb` + When I accept the recommended settings by removing `=begin` and `=end` from `spec_helper.rb` And I create "spec/addition_spec.rb" with the following content: """ruby RSpec.describe "Addition" do diff --git a/features/command_line/warnings_option.feature b/features/command_line/warnings_option.feature index 5b2dc0d135..25eadb8f7e 100644 --- a/features/command_line/warnings_option.feature +++ b/features/command_line/warnings_option.feature @@ -1,6 +1,6 @@ Feature: `--warnings` option (run with warnings enabled) - You can use the `--warnings` option to run specs with warnings enabled + Use the `--warnings` option to run specs with warnings enabled. @unsupported-on-rbx Scenario: diff --git a/features/metadata/described_class.feature b/features/metadata/described_class.feature index b494f5d4d6..13d40fbba4 100644 --- a/features/metadata/described_class.feature +++ b/features/metadata/described_class.feature @@ -6,7 +6,11 @@ Feature: described class Scenario: Access the described class from the example Given a file named "spec/example_spec.rb" with: """ruby - RSpec.describe Fixnum do + RSpec.describe Symbol do + it "is available as described_class" do + expect(described_class).to eq(Symbol) + end + describe 'inner' do describe String do it "is available as described_class" do diff --git a/features/step_definitions/additional_cli_steps.rb b/features/step_definitions/additional_cli_steps.rb index 73bd6467a9..f6ada18fa9 100644 --- a/features/step_definitions/additional_cli_steps.rb +++ b/features/step_definitions/additional_cli_steps.rb @@ -114,7 +114,7 @@ set_environment_variable('RUBYOPT', ENV['RUBYOPT'] + " -I#{gem_dir}/lib") end -When "I accept the recommended settings by removing `=begin` and `=end` from `spec/spec_helper.rb`" do +When('I accept the recommended settings by removing `=begin` and `=end` from `spec_helper.rb`') do cd('.') do spec_helper = File.read("spec/spec_helper.rb") expect(spec_helper).to include("=begin", "=end") diff --git a/features/support/diff_lcs_versions.rb b/features/support/diff_lcs_versions.rb index 2217b0de92..5cb8bdab5c 100644 --- a/features/support/diff_lcs_versions.rb +++ b/features/support/diff_lcs_versions.rb @@ -1,16 +1,16 @@ require 'diff-lcs' Around "@skip-when-diff-lcs-1.4" do |scenario, block| - if Diff::LCS::VERSION.to_f >= 1.4 - warn "Skipping scenario #{scenario.title} on `diff-lcs` v#{Diff::LCS::VERSION.to_f}" + if Diff::LCS::VERSION >= '1.4' + skip_this_scenario "Skipping scenario #{scenario.name} on `diff-lcs` v#{Diff::LCS::VERSION}" else block.call end end Around "@skip-when-diff-lcs-1.3" do |scenario, block| - if Diff::LCS::VERSION.to_f < 1.4 - warn "Skipping scenario #{scenario.title} on `diff-lcs` v#{Diff::LCS::VERSION.to_f}" + if Diff::LCS::VERSION < '1.4' + skip_this_scenario "Skipping scenario #{scenario.name} on `diff-lcs` v#{Diff::LCS::VERSION}" else block.call end diff --git a/features/support/env.rb b/features/support/env.rb index 01400a3f67..c61494b134 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -3,11 +3,13 @@ Before do # Force ids to be printed unquoted for consistency set_environment_variable('SHELL', '/usr/bin/bash') +end - if RUBY_PLATFORM =~ /java/ || defined?(Rubinius) - @aruba_timeout_seconds = 120 +Aruba.configure do |config| + config.exit_timeout = if RUBY_PLATFORM =~ /java/ || defined?(Rubinius) || (defined?(RUBY_ENGINE) && RUBY_ENGINE == 'truffleruby') + 120 else - @aruba_timeout_seconds = 10 + 10 end end diff --git a/features/support/jruby.rb b/features/support/jruby.rb index 7bdad62c6d..54467bb330 100644 --- a/features/support/jruby.rb +++ b/features/support/jruby.rb @@ -1,4 +1,8 @@ Around "@broken-on-jruby-9000" do |scenario, block| require 'rspec/support/ruby_features' - block.call unless RSpec::Support::Ruby.jruby_9000? + if RSpec::Support::Ruby.jruby_9000? + skip_this_scenario "Skipping scenario #{scenario.name} not supported on JRuby 9000" + else + block.call + end end diff --git a/features/support/require_expect_syntax_in_aruba_specs.rb b/features/support/require_expect_syntax_in_aruba_specs.rb index 5bd2519093..8bfacee141 100644 --- a/features/support/require_expect_syntax_in_aruba_specs.rb +++ b/features/support/require_expect_syntax_in_aruba_specs.rb @@ -1,6 +1,9 @@ if defined?(Cucumber) require 'shellwords' - Before('~@allow-should-syntax', '~@with-clean-spec-opts') do + use_tilde_tags = !defined?(::RUBY_ENGINE_VERSION) || (::RUBY_ENGINE_VERSION < '2.0.0') + exclude_allow_should_syntax = use_tilde_tags ? '~@allow-should-syntax' : 'not @allow-should-syntax' + exclude_with_clean_spec_ops = use_tilde_tags ? '~@with-clean-spec-opts' : 'not @with-clean-spec-opts' + Before(exclude_allow_should_syntax, exclude_with_clean_spec_ops) do set_environment_variable('SPEC_OPTS', "-r#{Shellwords.escape(__FILE__)}") end diff --git a/features/support/rubinius.rb b/features/support/rubinius.rb index 3907962528..34f052d363 100644 --- a/features/support/rubinius.rb +++ b/features/support/rubinius.rb @@ -2,5 +2,9 @@ ENV['RBXOPT'] = "#{ENV["RBXOPT"]} -Xcompiler.no_rbc" Around "@unsupported-on-rbx" do |scenario, block| - block.call unless defined?(Rubinius) + if defined?(Rubinius) + block.call + else + skip_this_scenario "Skipping scenario #{scenario.name} not supported on Rubinius" + end end diff --git a/features/support/ruby_27_support.rb b/features/support/ruby_27_support.rb index b44e89c69b..e6824a9335 100644 --- a/features/support/ruby_27_support.rb +++ b/features/support/ruby_27_support.rb @@ -2,6 +2,6 @@ if RUBY_VERSION.to_f == 2.7 block.call else - warn "Skipping scenario #{scenario.title} on Ruby v#{RUBY_VERSION}" + skip_this_scenario "Skipping scenario #{scenario.name} on Ruby v#{RUBY_VERSION}" end end diff --git a/lib/rspec/core/configuration.rb b/lib/rspec/core/configuration.rb index 4bf80f01f4..d44902449c 100644 --- a/lib/rspec/core/configuration.rb +++ b/lib/rspec/core/configuration.rb @@ -502,7 +502,8 @@ def bisect_runner=(value) # @private attr_reader :backtrace_formatter, :ordering_manager, :loaded_spec_files - # rubocop:disable Metrics/AbcSize, Metrics/MethodLength + # rubocop:disable Metrics/AbcSize + # rubocop:disable Metrics/MethodLength # Build an object to store runtime configuration options and set defaults def initialize @@ -561,7 +562,8 @@ def initialize define_built_in_hooks end - # rubocop:enable Metrics/MethodLength, Metrics/AbcSize + # rubocop:enable Metrics/AbcSize + # rubocop:enable Metrics/MethodLength # @private # diff --git a/lib/rspec/core/formatters/exception_presenter.rb b/lib/rspec/core/formatters/exception_presenter.rb index 26757a19a1..e90a769282 100644 --- a/lib/rspec/core/formatters/exception_presenter.rb +++ b/lib/rspec/core/formatters/exception_presenter.rb @@ -242,6 +242,10 @@ def find_failed_line line_regex = RSpec.configuration.in_project_source_dir_regex loaded_spec_files = RSpec.configuration.loaded_spec_files + exception_backtrace.reject! do |line| + line.start_with?("#{formatted_run_time}s" end - # rubocop:disable Metrics/ParameterLists def print_example_failed(pending_fixed, description, run_time, failure_id, exception, extra_content) - # rubocop:enable Metrics/ParameterLists formatted_run_time = "%.5f" % run_time @output.puts "
" @@ -215,7 +213,7 @@ def indentation_style(number_of_parents) } } EOF - # rubocop:enable LineLength + # rubocop:enable Layout/LineLength GLOBAL_STYLES = <<-EOF #rspec-header { diff --git a/lib/rspec/core/option_parser.rb b/lib/rspec/core/option_parser.rb index 3af69eefd7..35ed0c9501 100644 --- a/lib/rspec/core/option_parser.rb +++ b/lib/rspec/core/option_parser.rb @@ -32,11 +32,10 @@ def parse(source=nil) private - # rubocop:disable MethodLength # rubocop:disable Metrics/AbcSize - # rubocop:disable CyclomaticComplexity - # rubocop:disable PerceivedComplexity - # rubocop:disable Metrics/BlockLength + # rubocop:disable Metrics/MethodLength + # rubocop:disable Metrics/CyclomaticComplexity + # rubocop:disable Metrics/PerceivedComplexity def parser(options) OptionParser.new do |parser| parser.summary_width = 34 @@ -303,11 +302,10 @@ def parser(options) end end end - # rubocop:enable Metrics/BlockLength # rubocop:enable Metrics/AbcSize - # rubocop:enable MethodLength - # rubocop:enable CyclomaticComplexity - # rubocop:enable PerceivedComplexity + # rubocop:enable Metrics/MethodLength + # rubocop:enable Metrics/CyclomaticComplexity + # rubocop:enable Metrics/PerceivedComplexity def add_tag_filter(options, filter_type, tag_name, value=true) (options[filter_type] ||= {})[tag_name] = value diff --git a/lib/rspec/core/version.rb b/lib/rspec/core/version.rb index a4620887b3..b2667445af 100644 --- a/lib/rspec/core/version.rb +++ b/lib/rspec/core/version.rb @@ -3,7 +3,7 @@ module Core # Version information for RSpec Core. module Version # Current version of RSpec Core, in semantic versioning format. - STRING = '3.12.0.pre' + STRING = '3.12.0' end end end diff --git a/maintenance-branch b/maintenance-branch index ba2906d066..90ed1bf04f 100644 --- a/maintenance-branch +++ b/maintenance-branch @@ -1 +1 @@ -main +3-12-maintenance diff --git a/rspec-core.gemspec b/rspec-core.gemspec index a778f04dde..1d6e4f76e8 100644 --- a/rspec-core.gemspec +++ b/rspec-core.gemspec @@ -45,7 +45,7 @@ Gem::Specification.new do |s| s.add_runtime_dependency "rspec-support", "~> #{RSpec::Core::Version::STRING.split('.')[0..1].concat(['0']).join('.')}" end - s.add_development_dependency "cucumber", "~> 1.3" + s.add_development_dependency "cucumber", ">= 1.3" s.add_development_dependency "minitest", "~> 5.3" s.add_development_dependency "aruba", "~> 0.14.9" diff --git a/script/ci_functions.sh b/script/ci_functions.sh index 5c62a54c0a..bac93360d7 100644 --- a/script/ci_functions.sh +++ b/script/ci_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2022-01-30T10:38:31+00:00 from the rspec-dev repo. +# This file was generated on 2022-09-08T12:41:59+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # Taken from: diff --git a/script/clone_all_rspec_repos b/script/clone_all_rspec_repos index cc09066afb..bd9bf2bbcd 100755 --- a/script/clone_all_rspec_repos +++ b/script/clone_all_rspec_repos @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2022-01-30T10:38:31+00:00 from the rspec-dev repo. +# This file was generated on 2022-09-08T12:41:59+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e @@ -12,7 +12,7 @@ if is_mri; then clone_repo "rspec-core" clone_repo "rspec-expectations" clone_repo "rspec-mocks" - clone_repo "rspec-rails" + clone_repo "rspec-rails" "6-0-maintenance" if rspec_support_compatible; then clone_repo "rspec-support" diff --git a/script/cucumber.sh b/script/cucumber.sh index d1a15e9c49..7be6f49da8 100755 --- a/script/cucumber.sh +++ b/script/cucumber.sh @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2022-01-30T10:38:31+00:00 from the rspec-dev repo. +# This file was generated on 2022-09-08T12:41:59+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/functions.sh b/script/functions.sh index be534f2e2e..b582eeeac0 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2022-01-30T10:38:31+00:00 from the rspec-dev repo. +# This file was generated on 2022-09-08T12:41:59+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" @@ -192,6 +192,9 @@ function run_all_spec_suites { fold "rspec-expectations specs" run_spec_suite_for "rspec-expectations" fold "rspec-mocks specs" run_spec_suite_for "rspec-mocks" if rspec_rails_compatible; then + if ! is_ruby_27_plus; then + export RAILS_VERSION='~> 6.1.0' + fi fold "rspec-rails specs" run_spec_suite_for "rspec-rails" fi diff --git a/script/legacy_setup.sh b/script/legacy_setup.sh index 5b6d0eaa88..8899376f56 100755 --- a/script/legacy_setup.sh +++ b/script/legacy_setup.sh @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2022-01-30T10:38:31+00:00 from the rspec-dev repo. +# This file was generated on 2022-09-08T12:41:59+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index b0bc8387e5..d3a3563c82 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2022-01-30T10:38:31+00:00 from the rspec-dev repo. +# This file was generated on 2022-09-08T12:41:59+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. function is_mri { @@ -95,6 +95,14 @@ function is_ruby_25_plus { fi } +function is_ruby_27_plus { + if ruby -e "exit(RUBY_VERSION.to_f >= 2.7)"; then + return 0 + else + return 1 + fi +} + function is_ruby_31_plus { if ruby -e "exit(RUBY_VERSION.to_f >= 3.1)"; then return 0 diff --git a/script/rspec_with_simplecov b/script/rspec_with_simplecov index 92635dce93..fc7c6469de 100755 --- a/script/rspec_with_simplecov +++ b/script/rspec_with_simplecov @@ -34,7 +34,7 @@ begin minimum_coverage(100) end end -rescue LoadError +rescue LoadError # rubocop:disable Lint/SuppressedException ensure $VERBOSE = old_verbose end diff --git a/script/run_build b/script/run_build index b34864446f..448a825ff5 100755 --- a/script/run_build +++ b/script/run_build @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2022-01-30T10:38:31+00:00 from the rspec-dev repo. +# This file was generated on 2022-09-08T12:41:59+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/run_rubocop b/script/run_rubocop index ec26db85ba..8fe1774b2c 100755 --- a/script/run_rubocop +++ b/script/run_rubocop @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2022-01-30T10:38:31+00:00 from the rspec-dev repo. +# This file was generated on 2022-09-08T12:41:59+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/update_rubygems_and_install_bundler b/script/update_rubygems_and_install_bundler index 00cc7d4e89..8d51f56cab 100755 --- a/script/update_rubygems_and_install_bundler +++ b/script/update_rubygems_and_install_bundler @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2022-01-30T10:38:31+00:00 from the rspec-dev repo. +# This file was generated on 2022-09-08T12:41:59+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/spec/integration/spec_file_load_errors_spec.rb b/spec/integration/spec_file_load_errors_spec.rb index 118c1103ea..7daa3bb5e9 100644 --- a/spec/integration/spec_file_load_errors_spec.rb +++ b/spec/integration/spec_file_load_errors_spec.rb @@ -89,6 +89,9 @@ run_command "--require ./helper_with_exit.rb" }.to raise_error(SystemExit) output = normalize_durations(last_cmd_stdout) + # Remove extra line which is only shown on CRuby + output = output.sub("# ./helper_with_exit.rb:1:in `exit'\n", "") + if defined?(JRUBY_VERSION) && !JRUBY_VERSION.empty? expect(output).to eq unindent(<<-EOS) @@ -107,7 +110,6 @@ SystemExit: exit - # ./helper_with_exit.rb:1:in `exit' # ./helper_with_exit.rb:1#{spec_line_suffix} EOS end diff --git a/spec/rspec/core/filterable_item_repository_spec.rb b/spec/rspec/core/filterable_item_repository_spec.rb index b1a91597c4..99a526f93b 100644 --- a/spec/rspec/core/filterable_item_repository_spec.rb +++ b/spec/rspec/core/filterable_item_repository_spec.rb @@ -3,6 +3,8 @@ module Core RSpec.describe FilterableItemRepository, "#items_for" do FilterableItem = Struct.new(:name) + # rubocop:disable Metrics/AbcSize + # rubocop:disable Metrics/MethodLength def self.it_behaves_like_a_filterable_item_repo(&when_the_repo_has_items_with_metadata) let(:repo) { described_class.new(:any?) } let(:item_1) { FilterableItem.new("Item 1") } @@ -166,7 +168,8 @@ def self.it_behaves_like_a_filterable_item_repo(&when_the_repo_has_items_with_me end end end - + # rubocop:enable Metrics/AbcSize + # rubocop:enable Metrics/MethodLength describe FilterableItemRepository::UpdateOptimized do it_behaves_like_a_filterable_item_repo end diff --git a/spec/rspec/core_spec.rb b/spec/rspec/core_spec.rb index d9a02e97e7..5ce749da6a 100644 --- a/spec/rspec/core_spec.rb +++ b/spec/rspec/core_spec.rb @@ -13,6 +13,9 @@ # JRuby appears to not respect `--disable=gem` so rubygems also gets loaded. allowed_loaded_features << /rubygems/ if RSpec::Support::Ruby.jruby? + # Truffleruby cext files + allowed_loaded_features << /\/truffle\/cext/ if RSpec::Support::Ruby.truffleruby? + disable_autorun_code = if RSpec::Support::OS.windows? # On Windows, the "redefine autorun" approach results in a different