From 31af2df104564b6bc8cc44d8e93b40f83ab0b584 Mon Sep 17 00:00:00 2001 From: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> Date: Mon, 12 Sep 2022 18:15:56 +0000 Subject: [PATCH] brew vendor-gems: commit updates. --- .../Homebrew/vendor/bundle/bundler/setup.rb | 2 +- .../cop/rspec/capybara/specific_matcher.rb | 77 --------- .../lib/rubocop/cop/rspec/context_wording.rb | 77 --------- .../config/default.yml | 50 +++++- .../config/obsoletion.yml | 14 ++ .../lib/rubocop-rspec.rb | 3 + .../rubocop/cop/rspec/align_left_let_brace.rb | 17 +- .../cop/rspec/align_right_let_brace.rb | 17 +- .../lib/rubocop/cop/rspec/any_instance.rb | 1 + .../lib/rubocop/cop/rspec/around_block.rb | 29 +++- .../lib/rubocop/cop/rspec/base.rb | 0 .../lib/rubocop/cop/rspec/be.rb | 1 - .../lib/rubocop/cop/rspec/be_eq.rb | 1 - .../lib/rubocop/cop/rspec/be_eql.rb | 1 - .../lib/rubocop/cop/rspec/be_nil.rb | 0 .../lib/rubocop/cop/rspec/before_after_all.rb | 1 + .../capybara/current_path_expectation.rb | 12 +- .../cop/rspec/capybara/feature_methods.rb | 3 +- .../cop/rspec/capybara/specific_finders.rb | 86 ++++++++++ .../cop/rspec/capybara/specific_matcher.rb | 158 ++++++++++++++++++ .../cop/rspec/capybara/visibility_matcher.rb | 1 - .../lib/rubocop/cop/rspec/change_by_zero.rb | 65 ++++++- .../lib/rubocop/cop/rspec/class_check.rb | 101 +++++++++++ .../lib/rubocop/cop/rspec/context_method.rb | 3 +- .../lib/rubocop/cop/rspec/context_wording.rb | 108 ++++++++++++ .../lib/rubocop/cop/rspec/describe_class.rb | 2 +- .../lib/rubocop/cop/rspec/describe_method.rb | 1 + .../lib/rubocop/cop/rspec/describe_symbol.rb | 0 .../lib/rubocop/cop/rspec/described_class.rb | 18 +- .../rspec/described_class_module_wrapping.rb | 0 .../lib/rubocop/cop/rspec/dialect.rb | 1 + .../rubocop/cop/rspec/empty_example_group.rb | 23 ++- .../lib/rubocop/cop/rspec/empty_hook.rb | 3 +- .../cop/rspec/empty_line_after_example.rb | 13 +- .../rspec/empty_line_after_example_group.rb | 2 +- .../cop/rspec/empty_line_after_final_let.rb | 3 +- .../cop/rspec/empty_line_after_hook.rb | 34 +++- .../cop/rspec/empty_line_after_subject.rb | 3 +- .../lib/rubocop/cop/rspec/example_length.rb | 3 +- .../cop/rspec/example_without_description.rb | 3 +- .../lib/rubocop/cop/rspec/example_wording.rb | 3 +- .../cop/rspec/excessive_docstring_spacing.rb | 1 + .../lib/rubocop/cop/rspec/expect_actual.rb | 3 + .../lib/rubocop/cop/rspec/expect_change.rb | 2 +- .../lib/rubocop/cop/rspec/expect_in_hook.rb | 5 +- .../lib/rubocop/cop/rspec/expect_output.rb | 1 + .../attribute_defined_statically.rb | 3 +- .../cop/rspec/factory_bot/create_list.rb | 38 +++-- .../rspec/factory_bot/factory_class_name.rb | 1 + .../cop/rspec/factory_bot/syntax_methods.rb | 0 .../lib/rubocop/cop/rspec/file_path.rb | 9 +- .../lib/rubocop/cop/rspec/focus.rb | 18 ++ .../lib/rubocop/cop/rspec/hook_argument.rb | 9 +- .../cop/rspec/hooks_before_examples.rb | 19 ++- .../cop/rspec/identical_equality_assertion.rb | 1 - .../cop/rspec/implicit_block_expectation.rb | 1 + .../lib/rubocop/cop/rspec/implicit_expect.rb | 2 - .../lib/rubocop/cop/rspec/implicit_subject.rb | 0 .../lib/rubocop/cop/rspec/instance_spy.rb | 2 +- .../rubocop/cop/rspec/instance_variable.rb | 1 - .../lib/rubocop/cop/rspec/it_behaves_like.rb | 1 + .../rubocop/cop/rspec/iterated_expectation.rb | 16 ++ .../lib/rubocop/cop/rspec/leading_subject.rb | 30 ++-- .../cop/rspec/leaky_constant_declaration.rb | 0 .../rubocop/cop/rspec/let_before_examples.rb | 15 +- .../lib/rubocop/cop/rspec/let_setup.rb | 8 +- .../lib/rubocop/cop/rspec/message_chain.rb | 2 +- .../rubocop/cop/rspec/message_expectation.rb | 0 .../lib/rubocop/cop/rspec/message_spies.rb | 0 .../rspec/missing_example_group_argument.rb | 3 +- .../rubocop/cop/rspec/mixin/comments_help.rb | 0 .../rubocop/cop/rspec/mixin/css_selector.rb | 99 +++++++++++ .../cop/rspec/mixin/empty_line_separation.rb | 0 .../cop/rspec/mixin/final_end_location.rb | 0 .../cop/rspec/mixin/inside_example_group.rb | 0 .../lib/rubocop/cop/rspec/mixin/namespace.rb | 23 +++ .../cop/rspec/mixin/top_level_group.rb | 0 .../lib/rubocop/cop/rspec/mixin/variable.rb | 0 .../rubocop/cop/rspec/multiple_describes.rb | 1 + .../cop/rspec/multiple_expectations.rb | 6 +- .../cop/rspec/multiple_memoized_helpers.rb | 4 +- .../rubocop/cop/rspec/multiple_subjects.rb | 19 ++- .../lib/rubocop/cop/rspec/named_subject.rb | 3 +- .../lib/rubocop/cop/rspec/nested_groups.rb | 70 +++++--- .../cop/rspec/no_expectation_example.rb | 64 +++++++ .../lib/rubocop/cop/rspec/not_to_not.rb | 3 +- .../rubocop/cop/rspec/overwriting_setup.rb | 3 +- .../lib/rubocop/cop/rspec/pending.rb | 1 + .../rubocop/cop/rspec/predicate_matcher.rb | 3 +- .../cop/rspec/rails/avoid_setup_hook.rb | 3 +- .../cop/rspec/rails/have_http_status.rb | 0 .../rubocop/cop/rspec/rails/http_status.rb | 0 .../lib/rubocop/cop/rspec/receive_counts.rb | 29 ++-- .../lib/rubocop/cop/rspec/receive_never.rb | 9 +- .../rubocop/cop/rspec/repeated_description.rb | 55 +++--- .../lib/rubocop/cop/rspec/repeated_example.rb | 2 +- .../cop/rspec/repeated_example_group_body.rb | 57 ++++--- .../repeated_example_group_description.rb | 57 ++++--- .../cop/rspec/repeated_include_example.rb | 65 ++++--- .../lib/rubocop/cop/rspec/return_from_stub.rb | 2 +- .../lib/rubocop/cop/rspec/scattered_let.rb | 6 +- .../lib/rubocop/cop/rspec/scattered_setup.rb | 2 +- .../lib/rubocop/cop/rspec/shared_context.rb | 2 +- .../lib/rubocop/cop/rspec/shared_examples.rb | 0 .../rspec/single_argument_message_chain.rb | 0 .../lib/rubocop/cop/rspec/stubbed_mock.rb | 1 - .../rubocop/cop/rspec/subject_declaration.rb | 1 - .../lib/rubocop/cop/rspec/subject_stub.rb | 4 +- .../cop/rspec/unspecified_exception.rb | 30 ++-- .../rubocop/cop/rspec/variable_definition.rb | 1 + .../lib/rubocop/cop/rspec/variable_name.rb | 13 +- .../cop/rspec/verified_double_reference.rb | 0 .../lib/rubocop/cop/rspec/verified_doubles.rb | 1 + .../lib/rubocop/cop/rspec/void_expect.rb | 3 +- .../lib/rubocop/cop/rspec/yield.rb | 3 +- .../lib/rubocop/cop/rspec_cops.rb | 3 + .../rubocop-rspec-2.13.1/lib/rubocop/rspec.rb | 14 ++ .../lib/rubocop/rspec/align_let_brace.rb | 0 .../lib/rubocop/rspec/concept.rb | 0 .../lib/rubocop/rspec/config_formatter.rb | 17 +- .../lib/rubocop/rspec/corrector/move_node.rb | 0 .../rubocop/rspec/description_extractor.rb | 0 .../lib/rubocop/rspec/example.rb | 0 .../lib/rubocop/rspec/example_group.rb | 0 .../lib/rubocop/rspec/factory_bot.rb | 0 .../lib/rubocop/rspec/factory_bot/language.rb | 0 .../lib/rubocop/rspec/hook.rb | 0 .../lib/rubocop/rspec/inject.rb | 4 +- .../lib/rubocop/rspec/language.rb | 7 +- .../rubocop/rspec/language/node_pattern.rb | 4 + .../lib/rubocop/rspec/node.rb | 0 .../lib/rubocop/rspec/version.rb | 2 +- .../lib/rubocop/rspec/wording.rb | 4 +- 133 files changed, 1307 insertions(+), 524 deletions(-) delete mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/capybara/specific_matcher.rb delete mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/context_wording.rb rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/config/default.yml (95%) create mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/config/obsoletion.yml rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop-rspec.rb (92%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/align_left_let_brace.rb (79%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/align_right_let_brace.rb (77%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/any_instance.rb (99%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/around_block.rb (70%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/base.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/be.rb (99%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/be_eq.rb (99%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/be_eql.rb (99%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/be_nil.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/before_after_all.rb (99%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/capybara/current_path_expectation.rb (92%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/capybara/feature_methods.rb (97%) create mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/capybara/specific_finders.rb create mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/capybara/specific_matcher.rb rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/capybara/visibility_matcher.rb (99%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/change_by_zero.rb (53%) create mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/class_check.rb rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/context_method.rb (92%) create mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/context_wording.rb rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/describe_class.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/describe_method.rb (99%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/describe_symbol.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/described_class.rb (93%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/described_class_module_wrapping.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/dialect.rb (99%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/empty_example_group.rb (90%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/empty_hook.rb (92%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/empty_line_after_example.rb (86%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/empty_line_after_example_group.rb (92%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/empty_line_after_final_let.rb (91%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/empty_line_after_hook.rb (51%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/empty_line_after_subject.rb (90%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/example_length.rb (94%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/example_without_description.rb (96%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/example_wording.rb (97%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/excessive_docstring_spacing.rb (99%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/expect_actual.rb (96%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/expect_change.rb (97%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/expect_in_hook.rb (89%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/expect_output.rb (99%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb (97%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/factory_bot/create_list.rb (86%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/factory_bot/factory_class_name.rb (99%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/factory_bot/syntax_methods.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/file_path.rb (95%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/focus.rb (85%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/hook_argument.rb (92%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/hooks_before_examples.rb (79%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/identical_equality_assertion.rb (99%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/implicit_block_expectation.rb (99%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/implicit_expect.rb (99%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/implicit_subject.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/instance_spy.rb (96%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/instance_variable.rb (99%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/it_behaves_like.rb (99%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/iterated_expectation.rb (77%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/leading_subject.rb (71%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/leaky_constant_declaration.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/let_before_examples.rb (85%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/let_setup.rb (94%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/message_chain.rb (97%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/message_expectation.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/message_spies.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/missing_example_group_argument.rb (89%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/mixin/comments_help.rb (100%) create mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/mixin/css_selector.rb rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/mixin/empty_line_separation.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/mixin/final_end_location.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/mixin/inside_example_group.rb (100%) create mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/mixin/namespace.rb rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/mixin/top_level_group.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/mixin/variable.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/multiple_describes.rb (99%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/multiple_expectations.rb (98%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb (98%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/multiple_subjects.rb (83%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/named_subject.rb (96%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/nested_groups.rb (67%) create mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/no_expectation_example.rb rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/not_to_not.rb (99%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/overwriting_setup.rb (95%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/pending.rb (99%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/predicate_matcher.rb (99%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/rails/avoid_setup_hook.rb (92%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/rails/have_http_status.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/rails/http_status.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/receive_counts.rb (73%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/receive_never.rb (87%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/repeated_description.rb (62%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/repeated_example.rb (94%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/repeated_example_group_body.rb (71%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/repeated_example_group_description.rb (72%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/repeated_include_example.rb (67%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/return_from_stub.rb (98%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/scattered_let.rb (91%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/scattered_setup.rb (95%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/shared_context.rb (97%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/shared_examples.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/single_argument_message_chain.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/stubbed_mock.rb (99%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/subject_declaration.rb (99%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/subject_stub.rb (96%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/unspecified_exception.rb (70%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/variable_definition.rb (99%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/variable_name.rb (81%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/verified_double_reference.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/verified_doubles.rb (99%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/void_expect.rb (93%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec/yield.rb (96%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/cop/rspec_cops.rb (96%) create mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/rspec.rb rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/rspec/align_let_brace.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/rspec/concept.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/rspec/config_formatter.rb (72%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/rspec/corrector/move_node.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/rspec/description_extractor.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/rspec/example.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/rspec/example_group.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/rspec/factory_bot.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/rspec/factory_bot/language.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/rspec/hook.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/rspec/inject.rb (75%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/rspec/language.rb (97%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/rspec/language/node_pattern.rb (79%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/rspec/node.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/rspec/version.rb (86%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rspec-2.12.1 => rubocop-rspec-2.13.1}/lib/rubocop/rspec/wording.rb (94%) diff --git a/Library/Homebrew/vendor/bundle/bundler/setup.rb b/Library/Homebrew/vendor/bundle/bundler/setup.rb index 4bfa80a8b9..70dfb32f83 100644 --- a/Library/Homebrew/vendor/bundle/bundler/setup.rb +++ b/Library/Homebrew/vendor/bundle/bundler/setup.rb @@ -89,7 +89,7 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/unicode-display_width $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-1.35.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.14.3/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rails-2.16.0/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-2.12.1/lib" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-2.13.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-sorbet-0.6.11/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-macho-3.0.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/simplecov-html-0.12.3/lib" diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/capybara/specific_matcher.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/capybara/specific_matcher.rb deleted file mode 100644 index 2df783c905..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/capybara/specific_matcher.rb +++ /dev/null @@ -1,77 +0,0 @@ -# frozen_string_literal: true - -module RuboCop - module Cop - module RSpec - module Capybara - # Checks for there is a more specific matcher offered by Capybara. - # - # @example - # - # # bad - # expect(page).to have_selector('button') - # expect(page).to have_no_selector('button.cls') - # expect(page).to have_css('button') - # expect(page).to have_no_css('a.cls', exact_text: 'foo') - # expect(page).to have_css('table.cls') - # expect(page).to have_css('select') - # - # # good - # expect(page).to have_button - # expect(page).to have_no_button(class: 'cls') - # expect(page).to have_button - # expect(page).to have_no_link('foo', class: 'cls') - # expect(page).to have_table(class: 'cls') - # expect(page).to have_select - # - class SpecificMatcher < Base - MSG = 'Prefer `%s` over `%s`.' - RESTRICT_ON_SEND = %i[have_selector have_no_selector have_css - have_no_css].freeze - SPECIFIC_MATCHER = { - 'button' => 'button', - 'a' => 'link', - 'table' => 'table', - 'select' => 'select' - }.freeze - - # @!method first_argument(node) - def_node_matcher :first_argument, <<-PATTERN - (send nil? _ (str $_) ... ) - PATTERN - - def on_send(node) - return unless (arg = first_argument(node)) - return unless (matcher = specific_matcher(arg)) - return if acceptable_pattern?(arg) - - add_offense(node, message: message(node, matcher)) - end - - private - - def specific_matcher(arg) - splitted_arg = arg[/^\w+/, 0] - SPECIFIC_MATCHER[splitted_arg] - end - - def acceptable_pattern?(arg) - arg.match?(/\[.+=\w+\]/) || arg.match?(/[ >,+]/) - end - - def message(node, matcher) - format(MSG, - good_matcher: good_matcher(node, matcher), - bad_matcher: node.method_name) - end - - def good_matcher(node, matcher) - node.method_name - .to_s - .gsub(/selector|css/, matcher.to_s) - end - end - end - end - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/context_wording.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/context_wording.rb deleted file mode 100644 index 623468c95f..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/context_wording.rb +++ /dev/null @@ -1,77 +0,0 @@ -# frozen_string_literal: true - -module RuboCop - module Cop - module RSpec - # Checks that `context` docstring starts with an allowed prefix. - # - # The default list of prefixes is minimal. Users are encouraged to tailor - # the configuration to meet project needs. Other acceptable prefixes may - # include `if`, `unless`, `for`, `before`, `after`, or `during`. - # They may consist of multiple words if desired. - # - # @see https://rspec.rubystyle.guide/#context-descriptions - # @see http://www.betterspecs.org/#contexts - # - # @example `Prefixes` configuration - # - # # .rubocop.yml - # # RSpec/ContextWording: - # # Prefixes: - # # - when - # # - with - # # - without - # # - if - # # - unless - # # - for - # - # @example - # # bad - # context 'the display name not present' do - # # ... - # end - # - # # good - # context 'when the display name is not present' do - # # ... - # end - class ContextWording < Base - MSG = 'Start context description with %s.' - - # @!method context_wording(node) - def_node_matcher :context_wording, <<-PATTERN - (block (send #rspec? { :context :shared_context } $(str #bad_prefix?) ...) ...) - PATTERN - - def on_block(node) - context_wording(node) do |context| - add_offense(context, - message: format(MSG, prefixes: joined_prefixes)) - end - end - - private - - def bad_prefix?(description) - !prefix_regex.match?(description) - end - - def joined_prefixes - quoted = prefixes.map { |prefix| "'#{prefix}'" } - return quoted.first if quoted.size == 1 - - quoted << "or #{quoted.pop}" - quoted.join(', ') - end - - def prefixes - cop_config['Prefixes'] || [] - end - - def prefix_regex - /^#{Regexp.union(prefixes)}\b/ - end - end - end - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/config/default.yml b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/config/default.yml similarity index 95% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/config/default.yml rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/config/default.yml index b584a7c591..585923bf45 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/config/default.yml +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/config/default.yml @@ -2,6 +2,7 @@ RSpec: Enabled: true StyleGuideBaseURL: https://rspec.rubystyle.guide + DocumentationBaseURL: https://docs.rubocop.org/rubocop-rspec Include: &1 - "**/*_spec.rb" - "**/spec/**/*" @@ -61,9 +62,14 @@ RSpec: Pending: - pending Expectations: + - are_expected - expect - - is_expected - expect_any_instance_of + - is_expected + - should + - should_not + - should_not_receive + - should_receive Helpers: - let - let! @@ -187,8 +193,21 @@ RSpec/BeforeAfterAll: RSpec/ChangeByZero: Description: Prefer negated matchers over `to change.by(0)`. Enabled: pending - VersionAdded: 2.11.0 + VersionAdded: '2.11' + VersionChanged: '2.13' Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ChangeByZero + NegatedMatcher: ~ + +RSpec/ClassCheck: + Description: Enforces consistent use of `be_a` or `be_kind_of`. + StyleGuide: "#is-a-vs-kind-of" + Enabled: pending + VersionAdded: '2.13' + EnforcedStyle: be_a + SupportedStyles: + - be_a + - be_kind_of + Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ClassCheck RSpec/ContextMethod: Description: "`context` should not be used for specifying methods." @@ -204,8 +223,9 @@ RSpec/ContextWording: - when - with - without + AllowedPatterns: [] VersionAdded: '1.20' - VersionChanged: 1.20.1 + VersionChanged: '2.13' StyleGuide: https://rspec.rubystyle.guide/#context-descriptions Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ContextWording @@ -279,8 +299,9 @@ RSpec/Dialect: RSpec/EmptyExampleGroup: Description: Checks if an example group does not include any tests. Enabled: true + SafeAutoCorrect: false VersionAdded: '1.7' - VersionChanged: '2.0' + VersionChanged: '2.13' Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyExampleGroup RSpec/EmptyHook: @@ -315,8 +336,10 @@ RSpec/EmptyLineAfterHook: Description: Checks if there is an empty line after hook blocks. Enabled: true VersionAdded: '1.27' + VersionChanged: '2.13' StyleGuide: https://rspec.rubystyle.guide/#empty-line-after-let Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyLineAfterHook + AllowConsecutiveOneLiners: true RSpec/EmptyLineAfterSubject: Description: Checks if there is an empty line after subject block. @@ -607,10 +630,18 @@ RSpec/NestedGroups: Description: Checks for nested example groups. Enabled: true Max: 3 + AllowedGroups: [] VersionAdded: '1.7' - VersionChanged: '1.10' + VersionChanged: '2.13' Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NestedGroups +RSpec/NoExpectationExample: + Description: Checks if an example contains any expectation. + Enabled: pending + Safe: false + VersionAdded: '2.13' + Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NoExpectationExample + RSpec/NotToNot: Description: Checks for consistent method usage for negating expectations. Enabled: true @@ -775,9 +806,10 @@ RSpec/VariableName: SupportedStyles: - snake_case - camelCase + AllowedPatterns: [] IgnoredPatterns: [] VersionAdded: '1.40' - VersionChanged: '1.43' + VersionChanged: '2.13' Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VariableName RSpec/VerifiedDoubleReference: @@ -834,6 +866,12 @@ RSpec/Capybara/FeatureMethods: VersionChanged: '2.0' Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/FeatureMethods +RSpec/Capybara/SpecificFinders: + Description: Checks if there is a more specific finder offered by Capybara. + Enabled: pending + VersionAdded: '2.13' + Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/SpecificFinders + RSpec/Capybara/SpecificMatcher: Description: Checks for there is a more specific matcher offered by Capybara. Enabled: pending diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/config/obsoletion.yml b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/config/obsoletion.yml new file mode 100644 index 0000000000..38f27529a5 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/config/obsoletion.yml @@ -0,0 +1,14 @@ +# +# Configuration of obsolete/deprecated cops used by `ConfigObsoletion`. +# +# See: https://docs.rubocop.org/rubocop/extensions.html#config-obsoletions +# + +# Cop parameters that have been changed +# Can be treated as a warning instead of a failure with `severity: warning` +changed_parameters: + - cops: + - RSpec/VariableName + parameters: IgnoredPatterns + alternative: AllowedPatterns + severity: warning diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop-rspec.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop-rspec.rb similarity index 92% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop-rspec.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop-rspec.rb index cac7dc77d7..b1ae4329c7 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop-rspec.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop-rspec.rb @@ -5,6 +5,7 @@ require 'yaml' require 'rubocop' +require_relative 'rubocop/rspec' require_relative 'rubocop/rspec/version' require_relative 'rubocop/rspec/inject' require_relative 'rubocop/rspec/node' @@ -20,6 +21,8 @@ require_relative 'rubocop/cop/rspec/mixin/final_end_location' require_relative 'rubocop/cop/rspec/mixin/comments_help' require_relative 'rubocop/cop/rspec/mixin/empty_line_separation' require_relative 'rubocop/cop/rspec/mixin/inside_example_group' +require_relative 'rubocop/cop/rspec/mixin/namespace' +require_relative 'rubocop/cop/rspec/mixin/css_selector' require_relative 'rubocop/rspec/concept' require_relative 'rubocop/rspec/example_group' diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/align_left_let_brace.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/align_left_let_brace.rb similarity index 79% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/align_left_let_brace.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/align_left_let_brace.rb index 1d943c23e1..990222a686 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/align_left_let_brace.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/align_left_let_brace.rb @@ -6,16 +6,15 @@ module RuboCop # Checks that left braces for adjacent single line lets are aligned. # # @example + # # bad + # let(:foobar) { blahblah } + # let(:baz) { bar } + # let(:a) { b } # - # # bad - # let(:foobar) { blahblah } - # let(:baz) { bar } - # let(:a) { b } - # - # # good - # let(:foobar) { blahblah } - # let(:baz) { bar } - # let(:a) { b } + # # good + # let(:foobar) { blahblah } + # let(:baz) { bar } + # let(:a) { b } # class AlignLeftLetBrace < Base extend AutoCorrector diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/align_right_let_brace.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/align_right_let_brace.rb similarity index 77% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/align_right_let_brace.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/align_right_let_brace.rb index 93e7fc464a..cd33e6d8ef 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/align_right_let_brace.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/align_right_let_brace.rb @@ -6,16 +6,15 @@ module RuboCop # Checks that right braces for adjacent single line lets are aligned. # # @example + # # bad + # let(:foobar) { blahblah } + # let(:baz) { bar } + # let(:a) { b } # - # # bad - # let(:foobar) { blahblah } - # let(:baz) { bar } - # let(:a) { b } - # - # # good - # let(:foobar) { blahblah } - # let(:baz) { bar } - # let(:a) { b } + # # good + # let(:foobar) { blahblah } + # let(:baz) { bar } + # let(:a) { b } # class AlignRightLetBrace < Base extend AutoCorrector diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/any_instance.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/any_instance.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/any_instance.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/any_instance.rb index 282b0b7111..6c0e5bb8e1 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/any_instance.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/any_instance.rb @@ -22,6 +22,7 @@ module RuboCop # allow(my_instance).to receive(:foo) # end # end + # class AnyInstance < Base MSG = 'Avoid stubbing using `%s`.' RESTRICT_ON_SEND = %i[ diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/around_block.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/around_block.rb similarity index 70% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/around_block.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/around_block.rb index f2c1e29d56..4bf38ebd25 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/around_block.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/around_block.rb @@ -25,23 +25,29 @@ module RuboCop # some_method # test.run # end + # class AroundBlock < Base MSG_NO_ARG = 'Test object should be passed to around block.' MSG_UNUSED_ARG = 'You should call `%s.call` ' \ 'or `%s.run`.' - # @!method hook(node) - def_node_matcher :hook, <<-PATTERN + # @!method hook_block(node) + def_node_matcher :hook_block, <<-PATTERN (block (send nil? :around sym ?) (args $...) ...) PATTERN + # @!method hook_numblock(node) + def_node_matcher :hook_numblock, <<-PATTERN + (numblock (send nil? :around sym ?) ...) + PATTERN + # @!method find_arg_usage(node) def_node_search :find_arg_usage, <<-PATTERN {(send $... {:call :run}) (send _ _ $...) (yield $...) (block-pass $...)} PATTERN def on_block(node) - hook(node) do |(example_proxy)| + hook_block(node) do |(example_proxy)| if example_proxy.nil? add_no_arg_offense(node) else @@ -50,6 +56,12 @@ module RuboCop end end + def on_numblock(node) + hook_numblock(node) do + check_for_numblock(node) + end + end + private def add_no_arg_offense(node) @@ -68,6 +80,17 @@ module RuboCop message: format(MSG_UNUSED_ARG, arg: name) ) end + + def check_for_numblock(block) + find_arg_usage(block) do |usage| + return if usage.include?(s(:lvar, :_1)) + end + + add_offense( + block.children.last, + message: format(MSG_UNUSED_ARG, arg: :_1) + ) + end end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/base.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/base.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/base.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/base.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/be.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/be.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/be.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/be.rb index 30ae14fb45..e0b5f03a12 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/be.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/be.rb @@ -10,7 +10,6 @@ module RuboCop # cases it's better to specify what exactly is the expected value. # # @example - # # # bad # expect(foo).to be # diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/be_eq.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/be_eq.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/be_eq.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/be_eq.rb index 04cb5e40e6..d36c80a943 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/be_eq.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/be_eq.rb @@ -10,7 +10,6 @@ module RuboCop # the `be` matcher is preferable as it is a more strict test. # # @example - # # # bad # expect(foo).to eq(true) # expect(foo).to eq(false) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/be_eql.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/be_eql.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/be_eql.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/be_eql.rb index fdf7cc0401..8273e01254 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/be_eql.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/be_eql.rb @@ -11,7 +11,6 @@ module RuboCop # preferable as it is a more strict test. # # @example - # # # bad # expect(foo).to eql(1) # expect(foo).to eql(1.0) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/be_nil.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/be_nil.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/be_nil.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/be_nil.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/before_after_all.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/before_after_all.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/before_after_all.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/before_after_all.rb index eb18e7fbb4..7c3298c8fb 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/before_after_all.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/before_after_all.rb @@ -23,6 +23,7 @@ module RuboCop # before(:each) { Widget.create } # after(:each) { Widget.delete_all } # end + # class BeforeAfterAll < Base MSG = 'Beware of using `%s` as it may cause state to leak ' \ 'between tests. If you are using `rspec-rails`, and ' \ diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/capybara/current_path_expectation.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/capybara/current_path_expectation.rb similarity index 92% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/capybara/current_path_expectation.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/capybara/current_path_expectation.rb index 0606570ed5..a6568a0cb9 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/capybara/current_path_expectation.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/capybara/current_path_expectation.rb @@ -14,14 +14,20 @@ module RuboCop # which ensures that preceding actions (like `click_link`) have # completed. # + # This cop does not support autocorrection in some cases. + # # @example # # bad # expect(current_path).to eq('/callback') - # expect(page.current_path).to match(/widgets/) # # # good - # expect(page).to have_current_path("/callback") - # expect(page).to have_current_path(/widgets/) + # expect(page).to have_current_path('/callback') + # + # # bad (does not support autocorrection) + # expect(page.current_path).to match(variable) + # + # # good + # expect(page).to have_current_path('/callback') # class CurrentPathExpectation < Base extend AutoCorrector diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/capybara/feature_methods.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/capybara/feature_methods.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/capybara/feature_methods.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/capybara/feature_methods.rb index 413b5068b6..5fe49758ed 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/capybara/feature_methods.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/capybara/feature_methods.rb @@ -40,6 +40,7 @@ module RuboCop # # ... # end # end + # class FeatureMethods < Base extend AutoCorrector include InsideExampleGroup @@ -68,7 +69,7 @@ module RuboCop ...) PATTERN - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler return unless inside_example_group?(node) feature_method(node) do |send_node, match| diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/capybara/specific_finders.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/capybara/specific_finders.rb new file mode 100644 index 0000000000..398915f087 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/capybara/specific_finders.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module RSpec + module Capybara + # Checks if there is a more specific finder offered by Capybara. + # + # @example + # # bad + # find('#some-id') + # find('[visible][id=some-id]') + # + # # good + # find_by_id('some-id') + # find_by_id('some-id', visible: true) + # + class SpecificFinders < Base + extend AutoCorrector + + include RangeHelp + + MSG = 'Prefer `find_by` over `find`.' + RESTRICT_ON_SEND = %i[find].freeze + + # @!method find_argument(node) + def_node_matcher :find_argument, <<~PATTERN + (send _ :find (str $_) ...) + PATTERN + + def on_send(node) + find_argument(node) do |arg| + next if CssSelector.multiple_selectors?(arg) + + on_attr(node, arg) if attribute?(arg) + on_id(node, arg) if CssSelector.id?(arg) + end + end + + private + + def on_attr(node, arg) + return unless (id = CssSelector.attributes(arg)['id']) + + register_offense(node, replaced_arguments(arg, id)) + end + + def on_id(node, arg) + register_offense(node, "'#{arg.to_s.delete('#')}'") + end + + def attribute?(arg) + CssSelector.attribute?(arg) && + CssSelector.common_attributes?(arg) + end + + def register_offense(node, arg_replacement) + add_offense(offense_range(node)) do |corrector| + corrector.replace(node.loc.selector, 'find_by_id') + corrector.replace(node.first_argument.loc.expression, + arg_replacement) + end + end + + def replaced_arguments(arg, id) + options = to_options(CssSelector.attributes(arg)) + options.empty? ? id : "#{id}, #{options}" + end + + def to_options(attrs) + attrs.each.map do |key, value| + next if key == 'id' + + "#{key}: #{value}" + end.compact.join(', ') + end + + def offense_range(node) + range_between(node.loc.selector.begin_pos, + node.loc.end.end_pos) + end + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/capybara/specific_matcher.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/capybara/specific_matcher.rb new file mode 100644 index 0000000000..68ca7f6933 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/capybara/specific_matcher.rb @@ -0,0 +1,158 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module RSpec + module Capybara + # Checks for there is a more specific matcher offered by Capybara. + # + # @example + # + # # bad + # expect(page).to have_selector('button') + # expect(page).to have_no_selector('button.cls') + # expect(page).to have_css('button') + # expect(page).to have_no_css('a.cls', href: 'http://example.com') + # expect(page).to have_css('table.cls') + # expect(page).to have_css('select') + # expect(page).to have_css('input', exact_text: 'foo') + # + # # good + # expect(page).to have_button + # expect(page).to have_no_button(class: 'cls') + # expect(page).to have_button + # expect(page).to have_no_link('foo', class: 'cls', href: 'http://example.com') + # expect(page).to have_table(class: 'cls') + # expect(page).to have_select + # expect(page).to have_field('foo') + # + class SpecificMatcher < Base # rubocop:disable Metrics/ClassLength + MSG = 'Prefer `%s` over `%s`.' + RESTRICT_ON_SEND = %i[have_selector have_no_selector have_css + have_no_css].freeze + SPECIFIC_MATCHER = { + 'button' => 'button', + 'a' => 'link', + 'table' => 'table', + 'select' => 'select', + 'input' => 'field' + }.freeze + SPECIFIC_MATCHER_OPTIONS = { + 'button' => ( + CssSelector::COMMON_OPTIONS + %w[disabled name value title type] + ).freeze, + 'link' => ( + CssSelector::COMMON_OPTIONS + %w[href alt title download] + ).freeze, + 'table' => ( + CssSelector::COMMON_OPTIONS + %w[ + caption with_cols cols with_rows rows + ] + ).freeze, + 'select' => ( + CssSelector::COMMON_OPTIONS + %w[ + disabled name placeholder options enabled_options + disabled_options selected with_selected multiple with_options + ] + ).freeze, + 'field' => ( + CssSelector::COMMON_OPTIONS + %w[ + checked unchecked disabled valid name placeholder + validation_message readonly with type multiple + ] + ).freeze + }.freeze + SPECIFIC_MATCHER_PSEUDO_CLASSES = %w[ + not() disabled enabled checked unchecked + ].freeze + + # @!method first_argument(node) + def_node_matcher :first_argument, <<-PATTERN + (send nil? _ (str $_) ... ) + PATTERN + + # @!method option?(node) + def_node_search :option?, <<-PATTERN + (pair (sym %) _) + PATTERN + + def on_send(node) + first_argument(node) do |arg| + next unless (matcher = specific_matcher(arg)) + next if CssSelector.multiple_selectors?(arg) + next unless specific_matcher_option?(node, arg, matcher) + next unless specific_matcher_pseudo_classes?(arg) + + add_offense(node, message: message(node, matcher)) + end + end + + private + + def specific_matcher(arg) + splitted_arg = arg[/^\w+/, 0] + SPECIFIC_MATCHER[splitted_arg] + end + + def specific_matcher_option?(node, arg, matcher) + attrs = CssSelector.attributes(arg).keys + return true if attrs.empty? + return false unless replaceable_matcher?(node, matcher, attrs) + + attrs.all? do |attr| + SPECIFIC_MATCHER_OPTIONS.fetch(matcher, []).include?(attr) + end + end + + def specific_matcher_pseudo_classes?(arg) + CssSelector.pseudo_classes(arg).all? do |pseudo_class| + replaceable_pseudo_class?(pseudo_class, arg) + end + end + + def replaceable_pseudo_class?(pseudo_class, arg) + unless SPECIFIC_MATCHER_PSEUDO_CLASSES.include?(pseudo_class) + return false + end + + case pseudo_class + when 'not()' then replaceable_pseudo_class_not?(arg) + else true + end + end + + def replaceable_pseudo_class_not?(arg) + arg.scan(/not\(.*?\)/).all? do |not_arg| + CssSelector.attributes(not_arg).values.all? do |v| + v.is_a?(TrueClass) || v.is_a?(FalseClass) + end + end + end + + def replaceable_matcher?(node, matcher, attrs) + case matcher + when 'link' then replaceable_to_have_link?(node, attrs) + else true + end + end + + def replaceable_to_have_link?(node, attrs) + option?(node, :href) || attrs.include?('href') + end + + def message(node, matcher) + format(MSG, + good_matcher: good_matcher(node, matcher), + bad_matcher: node.method_name) + end + + def good_matcher(node, matcher) + node.method_name + .to_s + .gsub(/selector|css/, matcher.to_s) + end + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/capybara/visibility_matcher.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/capybara/visibility_matcher.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/capybara/visibility_matcher.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/capybara/visibility_matcher.rb index 163066e890..57098b8d4d 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/capybara/visibility_matcher.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/capybara/visibility_matcher.rb @@ -16,7 +16,6 @@ module RuboCop # https://www.rubydoc.info/gems/capybara/Capybara%2FNode%2FFinders:all[the documentation]. # # @example - # # # bad # expect(page).to have_selector('.foo', visible: false) # expect(page).to have_css('.foo', visible: true) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/change_by_zero.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/change_by_zero.rb similarity index 53% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/change_by_zero.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/change_by_zero.rb index 1174161497..70f8c722d4 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/change_by_zero.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/change_by_zero.rb @@ -5,12 +5,20 @@ module RuboCop module RSpec # Prefer negated matchers over `to change.by(0)`. # - # @example + # In the case of composite expectations, cop suggest using the + # negation matchers of `RSpec::Matchers#change`. + # + # By default the cop does not support autocorrect of + # compound expectations, but if you set the + # negated matcher for `change`, e.g. `not_change` with + # the `NegatedMatcher` option, the cop will perform the autocorrection. + # + # @example NegatedMatcher: ~ (default) # # bad # expect { run }.to change(Foo, :bar).by(0) # expect { run }.to change { Foo.bar }.by(0) # - # # bad - compound expectations + # # bad - compound expectations (does not support autocorrection) # expect { run } # .to change(Foo, :bar).by(0) # .and change(Foo, :baz).by(0) @@ -31,10 +39,28 @@ module RuboCop # .to not_change { Foo.bar } # .and not_change { Foo.baz } # + # @example NegatedMatcher: not_change + # # bad (support autocorrection to good case) + # expect { run } + # .to change(Foo, :bar).by(0) + # .and change(Foo, :baz).by(0) + # expect { run } + # .to change { Foo.bar }.by(0) + # .and change { Foo.baz }.by(0) + # + # # good + # define_negated_matcher :not_change, :change + # expect { run } + # .to not_change(Foo, :bar) + # .and not_change(Foo, :baz) + # expect { run } + # .to not_change { Foo.bar } + # .and not_change { Foo.baz } + # class ChangeByZero < Base extend AutoCorrector MSG = 'Prefer `not_to change` over `to change.by(0)`.' - MSG_COMPOUND = 'Prefer negated matchers with compound expectations ' \ + MSG_COMPOUND = 'Prefer %s with compound expectations ' \ 'over `change.by(0)`.' RESTRICT_ON_SEND = %i[change].freeze @@ -55,6 +81,11 @@ module RuboCop (int 0)) PATTERN + # @!method change_nodes(node) + def_node_search :change_nodes, <<-PATTERN + $(send nil? :change ...) + PATTERN + def on_send(node) expect_change_with_arguments(node.parent) do check_offense(node.parent) @@ -70,7 +101,9 @@ module RuboCop def check_offense(node) expression = node.loc.expression if compound_expectations?(node) - add_offense(expression, message: MSG_COMPOUND) + add_offense(expression, message: message_compound) do |corrector| + autocorrect_compound(corrector, node) + end else add_offense(expression) do |corrector| autocorrect(corrector, node) @@ -79,7 +112,7 @@ module RuboCop end def compound_expectations?(node) - %i[and or].include?(node.parent.method_name) + %i[and or & |].include?(node.parent.method_name) end def autocorrect(corrector, node) @@ -87,6 +120,28 @@ module RuboCop range = node.loc.dot.with(end_pos: node.loc.expression.end_pos) corrector.remove(range) end + + def autocorrect_compound(corrector, node) + return unless negated_matcher + + change_nodes(node) do |change_node| + corrector.replace(change_node.loc.selector, negated_matcher) + range = node.loc.dot.with(end_pos: node.loc.expression.end_pos) + corrector.remove(range) + end + end + + def negated_matcher + cop_config['NegatedMatcher'] + end + + def message_compound + format(MSG_COMPOUND, preferred: preferred_method) + end + + def preferred_method + negated_matcher ? "`#{negated_matcher}`" : 'negated matchers' + end end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/class_check.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/class_check.rb new file mode 100644 index 0000000000..5e426d5d23 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/class_check.rb @@ -0,0 +1,101 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module RSpec + # Enforces consistent use of `be_a` or `be_kind_of`. + # + # @example EnforcedStyle: be_a (default) + # # bad + # expect(object).to be_kind_of(String) + # expect(object).to be_a_kind_of(String) + # + # # good + # expect(object).to be_a(String) + # expect(object).to be_an(String) + # + # @example EnforcedStyle: be_kind_of + # # bad + # expect(object).to be_a(String) + # expect(object).to be_an(String) + # + # # good + # expect(object).to be_kind_of(String) + # expect(object).to be_a_kind_of(String) + # + class ClassCheck < Base + extend AutoCorrector + include ConfigurableEnforcedStyle + + MSG = 'Prefer `%s` over `%s`.' + + METHOD_NAMES_FOR_BE_A = ::Set[ + :be_a, + :be_an + ].freeze + + METHOD_NAMES_FOR_KIND_OF = ::Set[ + :be_a_kind_of, + :be_kind_of + ].freeze + + PREFERRED_METHOD_NAME_BY_STYLE = { + be_a: :be_a, + be_kind_of: :be_kind_of + }.freeze + + RESTRICT_ON_SEND = %i[ + be_a + be_a_kind_of + be_an + be_kind_of + ].freeze + + def on_send(node) + return unless offending?(node) + + add_offense( + node.loc.selector, + message: format_message(node) + ) do |corrector| + autocorrect(corrector, node) + end + end + + private + + def autocorrect(corrector, node) + corrector.replace(node.loc.selector, preferred_method_name) + end + + def format_message(node) + format( + MSG, + current: node.method_name, + preferred: preferred_method_name + ) + end + + def offending?(node) + !node.receiver && !preferred_method_name?(node.method_name) + end + + def preferred_method_name?(method_name) + preferred_method_names.include?(method_name) + end + + def preferred_method_name + PREFERRED_METHOD_NAME_BY_STYLE[style] + end + + def preferred_method_names + if style == :be_a + METHOD_NAMES_FOR_BE_A + else + METHOD_NAMES_FOR_KIND_OF + end + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/context_method.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/context_method.rb similarity index 92% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/context_method.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/context_method.rb index c0f52b5683..d639e18321 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/context_method.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/context_method.rb @@ -23,6 +23,7 @@ module RuboCop # describe '.foo_bar' do # # ... # end + # class ContextMethod < Base extend AutoCorrector @@ -33,7 +34,7 @@ module RuboCop (block (send #rspec? :context $(str #method_name?) ...) ...) PATTERN - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler context_method(node) do |context| add_offense(context) do |corrector| corrector.replace(node.send_node.loc.selector, 'describe') diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/context_wording.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/context_wording.rb new file mode 100644 index 0000000000..cb786a196c --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/context_wording.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module RSpec + # Checks that `context` docstring starts with an allowed prefix. + # + # The default list of prefixes is minimal. Users are encouraged to tailor + # the configuration to meet project needs. Other acceptable prefixes may + # include `if`, `unless`, `for`, `before`, `after`, or `during`. + # They may consist of multiple words if desired. + # + # @see https://rspec.rubystyle.guide/#context-descriptions + # @see http://www.betterspecs.org/#contexts + # + # @example `Prefixes` configuration + # # .rubocop.yml + # # RSpec/ContextWording: + # # Prefixes: + # # - when + # # - with + # # - without + # # - if + # # - unless + # # - for + # + # @example + # # bad + # context 'the display name not present' do + # # ... + # end + # + # # good + # context 'when the display name is not present' do + # # ... + # end + # + # This cop can be customized allowed context description pattern + # with `AllowedPatterns`. By default, there are no checking by pattern. + # + # @example `AllowedPatterns` configuration + # + # # .rubocop.yml + # # RSpec/ContextWording: + # # AllowedPatterns: + # # - /とき$/ + # + # @example + # # bad + # context '条件を満たす' do + # # ... + # end + # + # # good + # context '条件を満たすとき' do + # # ... + # end + # + class ContextWording < Base + include AllowedPattern + + MSG = 'Context description should match %s.' + + # @!method context_wording(node) + def_node_matcher :context_wording, <<-PATTERN + (block (send #rspec? { :context :shared_context } $(str $_) ...) ...) + PATTERN + + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler + context_wording(node) do |context, description| + if bad_pattern?(description) + message = format(MSG, patterns: expect_patterns) + add_offense(context, message: message) + end + end + end + + private + + def allowed_patterns + super + prefix_regexes + end + + def prefix_regexes + @prefix_regexes ||= prefixes.map { |pre| /^#{Regexp.escape(pre)}\b/ } + end + + def bad_pattern?(description) + return false if allowed_patterns.empty? + + !matches_allowed_pattern?(description) + end + + def expect_patterns + inspected = allowed_patterns.map(&:inspect) + return inspected.first if inspected.size == 1 + + inspected << "or #{inspected.pop}" + inspected.join(', ') + end + + def prefixes + Array(cop_config.fetch('Prefixes', [])) + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/describe_class.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/describe_class.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/describe_class.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/describe_class.rb index 9443220ee1..ab358678a2 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/describe_class.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/describe_class.rb @@ -10,7 +10,6 @@ module RuboCop # Ignores Rails and Aruba `type` metadata by default. # # @example `IgnoredMetadata` configuration - # # # .rubocop.yml # # RSpec/DescribeClass: # # IgnoredMetadata: @@ -34,6 +33,7 @@ module RuboCop # # describe "A feature example", type: :feature do # end + # class DescribeClass < Base include TopLevelGroup diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/describe_method.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/describe_method.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/describe_method.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/describe_method.rb index 8a8c114133..f5e266635b 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/describe_method.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/describe_method.rb @@ -16,6 +16,7 @@ module RuboCop # # describe MyClass, '.my_class_method' do # end + # class DescribeMethod < Base include TopLevelGroup diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/describe_symbol.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/describe_symbol.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/describe_symbol.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/describe_symbol.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/described_class.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/described_class.rb similarity index 93% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/described_class.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/described_class.rb index f1b4ed7300..06a3376916 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/described_class.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/described_class.rb @@ -57,6 +57,7 @@ module RuboCop class DescribedClass < Base extend AutoCorrector include ConfigurableEnforcedStyle + include Namespace DESCRIBED_CLASS = 'described_class' MSG = 'Use `%s` instead of `%s`.' @@ -81,7 +82,7 @@ module RuboCop def_node_search :contains_described_class?, '(send nil? :described_class)' - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler # In case the explicit style is used, we need to remember what's # being described. @described_class, body = described_constant(node) @@ -160,7 +161,8 @@ module RuboCop end def full_const_name(node) - collapse_namespace(namespace(node), const_name(node)) + symbolized_namespace = namespace(node).map(&:to_sym) + collapse_namespace(symbolized_namespace, const_name(node)) end # @param namespace [Array] @@ -200,18 +202,6 @@ module RuboCop [nil, name] end end - - # @param node [RuboCop::AST::Node] - # @return [Array] - # @example - # namespace(node) # => [:A, :B, :C] - def namespace(node) - node - .each_ancestor(:class, :module) - .reverse_each - .flat_map { |ancestor| ancestor.defined_module_name.split('::') } - .map(&:to_sym) - end end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/described_class_module_wrapping.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/described_class_module_wrapping.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/described_class_module_wrapping.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/described_class_module_wrapping.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/dialect.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/dialect.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/dialect.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/dialect.rb index 1fca3d0fdc..5c1770325c 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/dialect.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/dialect.rb @@ -41,6 +41,7 @@ module RuboCop # describe 'display name presence' do # # ... # end + # class Dialect < Base extend AutoCorrector include MethodPreference diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_example_group.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/empty_example_group.rb similarity index 90% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_example_group.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/empty_example_group.rb index e0162627c5..7fd30d3f8c 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_example_group.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/empty_example_group.rb @@ -6,7 +6,6 @@ module RuboCop # Checks if an example group does not include any tests. # # @example usage - # # # bad # describe Bacon do # let(:bacon) { Bacon.new(chunkiness) } @@ -35,7 +34,12 @@ module RuboCop # describe Bacon do # pending 'will add tests later' # end + # class EmptyExampleGroup < Base + extend AutoCorrector + + include RangeHelp + MSG = 'Empty example group detected.' # @!method example_group_body(node) @@ -119,7 +123,7 @@ module RuboCop # describe { it { i_run_as_well } } # # @example source that does not match - # before { it { whatever here wont run anyway } } + # before { it { whatever here won't run anyway } } # # @param node [RuboCop::AST::Node] # @return [Array] matching nodes @@ -130,12 +134,16 @@ module RuboCop } PATTERN - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler return if node.each_ancestor(:def, :defs).any? return if node.each_ancestor(:block).any? { |block| example?(block) } example_group_body(node) do |body| - add_offense(node.send_node) if offensive?(body) + next unless offensive?(body) + + add_offense(node.send_node) do |corrector| + corrector.remove(removed_range(node)) + end end end @@ -163,6 +171,13 @@ module RuboCop def examples_in_branches?(condition_node) condition_node.branches.any? { |branch| examples?(branch) } end + + def removed_range(node) + range_by_whole_lines( + node.location.expression, + include_final_newline: true + ) + end end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_hook.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/empty_hook.rb similarity index 92% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_hook.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/empty_hook.rb index 820c1c5328..6c088121ee 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_hook.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/empty_hook.rb @@ -22,6 +22,7 @@ module RuboCop # create_feed # end # after(:all) { cleanup_feed } + # class EmptyHook < Base extend AutoCorrector include RuboCop::Cop::RangeHelp @@ -33,7 +34,7 @@ module RuboCop (block $#{send_pattern('#Hooks.all')} _ nil?) PATTERN - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler empty_hook?(node) do |hook| add_offense(hook) do |corrector| corrector.remove( diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_example.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/empty_line_after_example.rb similarity index 86% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_example.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/empty_line_after_example.rb index 9122251883..bfab9ffc19 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_example.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/empty_line_after_example.rb @@ -30,7 +30,6 @@ module RuboCop # end # # @example with AllowConsecutiveOneLiners configuration - # # # rubocop.yml # # RSpec/EmptyLineAfterExample: # # AllowConsecutiveOneLiners: false @@ -47,7 +46,7 @@ module RuboCop MSG = 'Add an empty line after `%s`.' - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler return unless example?(node) return if allowed_one_liner?(node) @@ -65,19 +64,15 @@ module RuboCop end def consecutive_one_liner?(node) - node.line_count == 1 && next_one_line_example?(node) + node.single_line? && next_one_line_example?(node) end def next_one_line_example?(node) - next_sibling = next_sibling(node) + next_sibling = node.right_sibling return unless next_sibling return unless example?(next_sibling) - next_sibling.line_count == 1 - end - - def next_sibling(node) - node.parent.children[node.sibling_index + 1] + next_sibling.single_line? end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_example_group.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/empty_line_after_example_group.rb similarity index 92% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_example_group.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/empty_line_after_example_group.rb index e0f89f8854..d43573d478 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_example_group.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/empty_line_after_example_group.rb @@ -29,7 +29,7 @@ module RuboCop MSG = 'Add an empty line after `%s`.' - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler return unless example_group?(node) missing_separating_line_offense(node) do |method| diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_final_let.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/empty_line_after_final_let.rb similarity index 91% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_final_let.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/empty_line_after_final_let.rb index 1f91190edf..72f0fc1856 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_final_let.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/empty_line_after_final_let.rb @@ -16,13 +16,14 @@ module RuboCop # let(:something) { other } # # it { does_something } + # class EmptyLineAfterFinalLet < Base extend AutoCorrector include EmptyLineSeparation MSG = 'Add an empty line after the last `%s`.' - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler return unless example_group_with_body?(node) final_let = node.body.child_nodes.reverse.find { |child| let?(child) } diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_hook.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/empty_line_after_hook.rb similarity index 51% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_hook.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/empty_line_after_hook.rb index bf2ae16f68..cfcd8d30af 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_hook.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/empty_line_after_hook.rb @@ -5,6 +5,9 @@ module RuboCop module RSpec # Checks if there is an empty line after hook blocks. # + # `AllowConsecutiveOneLiners` configures whether adjacent + # one-line definitions are considered an offense. + # # @example # # bad # before { do_something } @@ -19,11 +22,23 @@ module RuboCop # it { does_something } # # # good - # before { do_something } + # after { do_something } # # it { does_something } # - # # good + # # fair - it's ok to have non-separated one-liners hooks + # around { |test| test.run } + # after { do_something } + # + # it { does_something } + # + # @example with AllowConsecutiveOneLiners configuration + # # rubocop.yml + # # RSpec/EmptyLineAfterHook: + # # AllowConsecutiveOneLiners: false + # + # # bad + # around { |test| test.run } # after { do_something } # # it { does_something } @@ -31,21 +46,36 @@ module RuboCop # # good # around { |test| test.run } # + # after { do_something } + # # it { does_something } # class EmptyLineAfterHook < Base extend AutoCorrector + include ConfigurableEnforcedStyle include EmptyLineSeparation MSG = 'Add an empty line after `%s`.' def on_block(node) return unless hook?(node) + return if cop_config['AllowConsecutiveOneLiners'] && + chained_single_line_hooks?(node) missing_separating_line_offense(node) do |method| format(MSG, hook: method) end end + + alias on_numblock on_block + + private + + def chained_single_line_hooks?(node) + next_node = node.right_sibling + + hook?(next_node) && node.single_line? && next_node.single_line? + end end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_subject.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/empty_line_after_subject.rb similarity index 90% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_subject.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/empty_line_after_subject.rb index 47d515d842..f232e3fa56 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_subject.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/empty_line_after_subject.rb @@ -14,6 +14,7 @@ module RuboCop # subject(:obj) { described_class } # # let(:foo) { bar } + # class EmptyLineAfterSubject < Base extend AutoCorrector include EmptyLineSeparation @@ -21,7 +22,7 @@ module RuboCop MSG = 'Add an empty line after `%s`.' - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler return unless subject?(node) return unless inside_example_group?(node) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_length.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/example_length.rb similarity index 94% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_length.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/example_length.rb index 9f5625046c..2796ef0420 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_length.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/example_length.rb @@ -47,12 +47,13 @@ module RuboCop # content. # HEREDOC # end # 5 points + # class ExampleLength < Base include CodeLength LABEL = 'Example' - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler return unless example?(node) check_code_length(node) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_without_description.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/example_without_description.rb similarity index 96% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_without_description.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/example_without_description.rb index 3ada55b5bf..8d52098491 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_without_description.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/example_without_description.rb @@ -47,6 +47,7 @@ module RuboCop # result = service.call # expect(result).to be(true) # end + # class ExampleWithoutDescription < Base include ConfigurableEnforcedStyle @@ -57,7 +58,7 @@ module RuboCop # @!method example_description(node) def_node_matcher :example_description, '(send nil? _ $(str $_))' - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler return unless example?(node) check_example_without_description(node.send_node) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_wording.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/example_wording.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_wording.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/example_wording.rb index 19d460164d..90850b4894 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_wording.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/example_wording.rb @@ -29,6 +29,7 @@ module RuboCop # # good # it 'does things' do # end + # class ExampleWording < Base extend AutoCorrector @@ -46,7 +47,7 @@ module RuboCop } ...) ...) PATTERN - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler it_description(node) do |description_node, message| if message.match?(SHOULD_PREFIX) add_wording_offense(description_node, MSG_SHOULD) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/excessive_docstring_spacing.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/excessive_docstring_spacing.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/excessive_docstring_spacing.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/excessive_docstring_spacing.rb index bc9800505e..0b3d3d0000 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/excessive_docstring_spacing.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/excessive_docstring_spacing.rb @@ -22,6 +22,7 @@ module RuboCop # # good # context 'when a condition is met' do # end + # class ExcessiveDocstringSpacing < Base extend AutoCorrector diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_actual.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/expect_actual.rb similarity index 96% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_actual.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/expect_actual.rb index 9f5867f960..3a50fc931b 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_actual.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/expect_actual.rb @@ -18,6 +18,9 @@ module RuboCop # expect(pattern).to eq(/foo/) # expect(name).to eq("John") # + # # bad (not supported autocorrection) + # expect(false).to eq(true) + # class ExpectActual < Base extend AutoCorrector diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_change.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/expect_change.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_change.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/expect_change.rb index 8864ca3489..e723e033a8 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_change.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/expect_change.rb @@ -69,7 +69,7 @@ module RuboCop end end - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler return unless style == :method_call expect_change_with_block(node) do |receiver, message| diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_in_hook.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/expect_in_hook.rb similarity index 89% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_in_hook.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/expect_in_hook.rb index c111f150b9..166ecc9ff8 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_in_hook.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/expect_in_hook.rb @@ -20,13 +20,14 @@ module RuboCop # it do # expect(something).to eq 'foo' # end + # class ExpectInHook < Base MSG = 'Do not use `%s` in `%s` hook' # @!method expectation(node) def_node_search :expectation, send_pattern('#Expectations.all') - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler return unless hook?(node) return if node.body.nil? @@ -36,6 +37,8 @@ module RuboCop end end + alias on_numblock on_block + private def message(expect, hook) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_output.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/expect_output.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_output.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/expect_output.rb index 70e8a771cc..bc57dcdded 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_output.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/expect_output.rb @@ -14,6 +14,7 @@ module RuboCop # # # good # expect { my_app.print_report }.to output('Hello World').to_stdout + # class ExpectOutput < Base MSG = 'Use `expect { ... }.to output(...).to_%s` ' \ 'instead of mutating $%s.' diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb index a4b6dbe17c..41b2b13145 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb @@ -24,6 +24,7 @@ module RuboCop # # # good # count { 1 } + # class AttributeDefinedStatically < Base extend AutoCorrector @@ -39,7 +40,7 @@ module RuboCop (block (send _ #attribute_defining_method? ...) _ { (begin $...) $(send ...) } ) PATTERN - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler attributes = factory_attributes(node) || [] attributes = [attributes] unless attributes.is_a?(Array) # rubocop:disable Style/ArrayCoercion, Lint/RedundantCopDisableDirective diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb similarity index 86% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb index 12db0979ea..986a3e708b 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb @@ -30,6 +30,7 @@ module RuboCop # # # good # 3.times { create :user } + # class CreateList < Base extend AutoCorrector include ConfigurableEnforcedStyle @@ -39,20 +40,23 @@ module RuboCop MSG_N_TIMES = 'Prefer %s.times.' RESTRICT_ON_SEND = %i[create_list].freeze - # @!method n_times_block?(node) - def_node_matcher :n_times_block?, <<-PATTERN + # @!method array_new_or_n_times_block?(node) + def_node_matcher :array_new_or_n_times_block?, <<-PATTERN (block - (send (int _) :times) + { + (send (const {nil? | cbase} :Array) :new (int _)) | + (send (int _) :times) + } ... ) PATTERN - # @!method n_times_block_with_arg_and_used?(node) - def_node_matcher :n_times_block_with_arg_and_used?, <<-PATTERN + # @!method block_with_arg_and_used?(node) + def_node_matcher :block_with_arg_and_used?, <<-PATTERN (block - (send (int _) :times) + _ (args (arg _value)) - `_value + `_value ) PATTERN @@ -71,11 +75,11 @@ module RuboCop (send {nil? #factory_bot?} :create_list (sym _) (int $_) ...) PATTERN - def on_block(node) + def on_block(node) # rubocop:todo InternalAffairs/NumblockHandler return unless style == :create_list - return unless n_times_block?(node) - return if n_times_block_with_arg_and_used?(node) + return unless array_new_or_n_times_block?(node) + return if block_with_arg_and_used?(node) return unless node.body return if arguments_include_method_call?(node.body) return unless contains_only_factory?(node.body) @@ -183,7 +187,7 @@ module RuboCop def call_with_block_replacement(node) block = node.body - arguments = build_arguments(block, node.receiver.source) + arguments = build_arguments(block, count_from(node)) replacement = format_receiver(block.receiver) replacement += format_method_call(block, 'create_list', arguments) replacement += format_block(block) @@ -203,7 +207,7 @@ module RuboCop block = node.body factory, *options = *block.arguments - arguments = "#{factory.source}, #{node.receiver.source}" + arguments = "#{factory.source}, #{count_from(node)}" options = build_options_string(options) arguments += ", #{options}" unless options.empty? @@ -212,6 +216,16 @@ module RuboCop replacement end + def count_from(node) + count_node = + if node.receiver.int_type? + node.receiver + else + node.send_node.first_argument + end + count_node.source + end + def format_block(node) if node.body.begin_type? format_multiline_block(node) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/factory_class_name.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/factory_bot/factory_class_name.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/factory_class_name.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/factory_bot/factory_class_name.rb index 2deb3584ff..a69a4cd7f9 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/factory_class_name.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/factory_bot/factory_class_name.rb @@ -19,6 +19,7 @@ module RuboCop # # good # factory :foo, class: 'Foo' do # end + # class FactoryClassName < Base extend AutoCorrector diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/syntax_methods.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/factory_bot/syntax_methods.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/syntax_methods.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/factory_bot/syntax_methods.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/file_path.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/file_path.rb similarity index 95% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/file_path.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/file_path.rb index 00ff71508b..2ef8a71590 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/file_path.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/file_path.rb @@ -58,6 +58,7 @@ module RuboCop # class FilePath < Base include TopLevelGroup + include Namespace MSG = 'Spec path should end with `%s`.' @@ -101,7 +102,7 @@ module RuboCop def pattern_for(example_group, method_name) if spec_suffix_only? || !example_group.const_type? - return pattern_for_spec_suffix_only? + return pattern_for_spec_suffix_only end [ @@ -111,7 +112,7 @@ module RuboCop ].join end - def pattern_for_spec_suffix_only? + def pattern_for_spec_suffix_only '.*_spec\.rb' end @@ -123,8 +124,10 @@ module RuboCop end def expected_path(constant) + constants = namespace(constant) + constant.const_name.split('::') + File.join( - constant.const_name.split('::').map do |name| + constants.map do |name| custom_transform.fetch(name) { camel_to_snake_case(name) } end ) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/focus.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/focus.rb similarity index 85% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/focus.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/focus.rb index 2ecaeba076..3e5da5a542 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/focus.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/focus.rb @@ -5,6 +5,8 @@ module RuboCop module RSpec # Checks if examples are focused. # + # This cop does not support autocorrection in some cases. + # # @example # # bad # describe MyClass, focus: true do @@ -19,6 +21,22 @@ module RuboCop # # good # describe MyClass do # end + # + # # bad + # fdescribe 'test' do; end + # + # # good + # describe 'test' do; end + # + # # bad + # fdescribe 'test' do; end + # + # # good + # describe 'test' do; end + # + # # bad (does not support autocorrection) + # focus 'test' do; end + # class Focus < Base extend AutoCorrector include RangeHelp diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/hook_argument.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/hook_argument.rb similarity index 92% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/hook_argument.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/hook_argument.rb index 5fa9c8f41c..2d1cb4f7c7 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/hook_argument.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/hook_argument.rb @@ -57,6 +57,7 @@ module RuboCop # before(:example) do # # ... # end + # class HookArgument < Base extend AutoCorrector include ConfigurableEnforcedStyle @@ -66,11 +67,13 @@ module RuboCop # @!method scoped_hook(node) def_node_matcher :scoped_hook, <<-PATTERN - (block $(send _ #Hooks.all (sym ${:each :example})) ...) + ({block numblock} $(send _ #Hooks.all (sym ${:each :example})) ...) PATTERN # @!method unscoped_hook(node) - def_node_matcher :unscoped_hook, '(block $(send _ #Hooks.all) ...)' + def_node_matcher :unscoped_hook, <<-PATTERN + ({block numblock} $(send _ #Hooks.all) ...) + PATTERN def on_block(node) hook(node) do |method_send, scope_name| @@ -86,6 +89,8 @@ module RuboCop end end + alias on_numblock on_block + private def check_implicit(method_send) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/hooks_before_examples.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/hooks_before_examples.rb similarity index 79% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/hooks_before_examples.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/hooks_before_examples.rb index 412314a2c8..bff319d2f6 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/hooks_before_examples.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/hooks_before_examples.rb @@ -6,8 +6,7 @@ module RuboCop # Checks for before/around/after hooks that come after an example. # # @example - # # Bad - # + # # bad # it 'checks what foo does' do # expect(foo).to be # end @@ -15,7 +14,7 @@ module RuboCop # before { prepare } # after { clean_up } # - # # Good + # # good # before { prepare } # after { clean_up } # @@ -32,6 +31,7 @@ module RuboCop def_node_matcher :example_or_group?, <<-PATTERN { #{block_pattern('{#ExampleGroups.all #Examples.all}')} + #{numblock_pattern('{#ExampleGroups.all #Examples.all}')} #{send_pattern('#Includes.examples')} } PATTERN @@ -42,6 +42,8 @@ module RuboCop check_hooks(node.body) if multiline_block?(node.body) end + alias on_numblock on_block + private def multiline_block?(block) @@ -52,13 +54,12 @@ module RuboCop first_example = find_first_example(node) return unless first_example - node.each_child_node do |child| - next if child.sibling_index < first_example.sibling_index - next unless hook?(child) + first_example.right_siblings.each do |sibling| + next unless hook?(sibling) - msg = format(MSG, hook: child.method_name) - add_offense(child, message: msg) do |corrector| - autocorrect(corrector, child, first_example) + msg = format(MSG, hook: sibling.method_name) + add_offense(sibling, message: msg) do |corrector| + autocorrect(corrector, sibling, first_example) end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/identical_equality_assertion.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/identical_equality_assertion.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/identical_equality_assertion.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/identical_equality_assertion.rb index 89f911b999..7298415c93 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/identical_equality_assertion.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/identical_equality_assertion.rb @@ -6,7 +6,6 @@ module RuboCop # Checks for equality assertions with identical expressions on both sides. # # @example - # # # bad # expect(foo.bar).to eq(foo.bar) # expect(foo.bar).to eql(foo.bar) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_block_expectation.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/implicit_block_expectation.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_block_expectation.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/implicit_block_expectation.rb index 9ad8a360d7..a9f8993965 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_block_expectation.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/implicit_block_expectation.rb @@ -16,6 +16,7 @@ module RuboCop # it 'changes something to a new value' do # expect { do_something }.to change(something).to(new_value) # end + # class ImplicitBlockExpectation < Base MSG = 'Avoid implicit block expectations.' RESTRICT_ON_SEND = %i[is_expected should should_not].freeze diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_expect.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/implicit_expect.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_expect.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/implicit_expect.rb index e69f669785..c2f8650bda 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_expect.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/implicit_expect.rb @@ -9,7 +9,6 @@ module RuboCop # and supports the `--auto-gen-config` flag. # # @example `EnforcedStyle: is_expected` (default) - # # # bad # it { should be_truthy } # @@ -17,7 +16,6 @@ module RuboCop # it { is_expected.to be_truthy } # # @example `EnforcedStyle: should` - # # # bad # it { is_expected.to be_truthy } # diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_subject.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/implicit_subject.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_subject.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/implicit_subject.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/instance_spy.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/instance_spy.rb similarity index 96% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/instance_spy.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/instance_spy.rb index 5b186ecff8..bcb37c4600 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/instance_spy.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/instance_spy.rb @@ -42,7 +42,7 @@ module RuboCop ...) PATTERN - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler return unless example?(node) null_double(node) do |var, receiver| diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/instance_variable.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/instance_variable.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/instance_variable.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/instance_variable.rb index ea1aab4dfe..0ce0298ba2 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/instance_variable.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/instance_variable.rb @@ -24,7 +24,6 @@ module RuboCop # end # # @example with AssignmentOnly configuration - # # # rubocop.yml # # RSpec/InstanceVariable: # # AssignmentOnly: false diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/it_behaves_like.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/it_behaves_like.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/it_behaves_like.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/it_behaves_like.rb index 8ed681ff21..a8f76cbac3 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/it_behaves_like.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/it_behaves_like.rb @@ -18,6 +18,7 @@ module RuboCop # # # good # it_should_behave_like 'a foo' + # class ItBehavesLike < Base extend AutoCorrector include ConfigurableEnforcedStyle diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/iterated_expectation.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/iterated_expectation.rb similarity index 77% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/iterated_expectation.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/iterated_expectation.rb index 58bef7acd6..7d65851a46 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/iterated_expectation.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/iterated_expectation.rb @@ -15,6 +15,7 @@ module RuboCop # it 'validates users' do # expect([user1, user2, user3]).to all(be_valid) # end + # class IteratedExpectation < Base MSG = 'Prefer using the `all` matcher instead ' \ 'of iterating over an array.' @@ -28,6 +29,13 @@ module RuboCop ) PATTERN + # @!method each_numblock?(node) + def_node_matcher :each_numblock?, <<-PATTERN + (numblock + (send ... :each) _ $(...) + ) + PATTERN + # @!method expectation?(node) def_node_matcher :expectation?, <<-PATTERN (send (send nil? :expect (lvar %)) :to ...) @@ -41,6 +49,14 @@ module RuboCop end end + def on_numblock(node) + each_numblock?(node) do |body| + if single_expectation?(body, :_1) || only_expectations?(body, :_1) + add_offense(node.send_node) + end + end + end + private def single_expectation?(body, arg) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/leading_subject.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/leading_subject.rb similarity index 71% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/leading_subject.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/leading_subject.rb index c1ceb28770..c5ec22fd74 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/leading_subject.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/leading_subject.rb @@ -7,29 +7,29 @@ module RuboCop # # @example # # bad - # let(:params) { blah } - # subject { described_class.new(params) } + # let(:params) { blah } + # subject { described_class.new(params) } # - # before { do_something } - # subject { described_class.new(params) } + # before { do_something } + # subject { described_class.new(params) } # - # it { expect_something } - # subject { described_class.new(params) } - # it { expect_something_else } + # it { expect_something } + # subject { described_class.new(params) } + # it { expect_something_else } # # # # good - # subject { described_class.new(params) } - # let(:params) { blah } + # subject { described_class.new(params) } + # let(:params) { blah } # # # good - # subject { described_class.new(params) } - # before { do_something } + # subject { described_class.new(params) } + # before { do_something } # # # good - # subject { described_class.new(params) } - # it { expect_something } - # it { expect_something_else } + # subject { described_class.new(params) } + # it { expect_something } + # it { expect_something_else } # class LeadingSubject < Base extend AutoCorrector @@ -37,7 +37,7 @@ module RuboCop MSG = 'Declare `subject` above any other `%s` declarations.' - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler return unless subject?(node) return unless inside_example_group?(node) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/leaky_constant_declaration.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/leaky_constant_declaration.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/leaky_constant_declaration.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/leaky_constant_declaration.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/let_before_examples.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/let_before_examples.rb similarity index 85% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/let_before_examples.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/let_before_examples.rb index 3df02cc57c..5059b568b1 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/let_before_examples.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/let_before_examples.rb @@ -6,7 +6,7 @@ module RuboCop # Checks for `let` definitions that come after an example. # # @example - # # Bad + # # bad # let(:foo) { bar } # # it 'checks what foo does' do @@ -19,7 +19,7 @@ module RuboCop # expect(some).to be # end # - # # Good + # # good # let(:foo) { bar } # let(:some) { other } # @@ -43,7 +43,7 @@ module RuboCop } PATTERN - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler return unless example_group_with_body?(node) check_let_declarations(node.body) if multiline_block?(node.body) @@ -59,12 +59,11 @@ module RuboCop first_example = find_first_example(node) return unless first_example - node.each_child_node do |child| - next if child.sibling_index < first_example.sibling_index - next unless let?(child) + first_example.right_siblings.each do |sibling| + next unless let?(sibling) - add_offense(child) do |corrector| - autocorrect(corrector, child, first_example) + add_offense(sibling) do |corrector| + autocorrect(corrector, sibling, first_example) end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/let_setup.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/let_setup.rb similarity index 94% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/let_setup.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/let_setup.rb index 482e4de589..6767b8fbd1 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/let_setup.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/let_setup.rb @@ -6,20 +6,20 @@ module RuboCop # Checks unreferenced `let!` calls being used for test setup. # # @example - # # Bad + # # bad # let!(:my_widget) { create(:widget) } # # it 'counts widgets' do # expect(Widget.count).to eq(1) # end # - # # Good + # # good # it 'counts widgets' do # create(:widget) # expect(Widget.count).to eq(1) # end # - # # Good + # # good # before { create(:widget) } # # it 'counts widgets' do @@ -49,7 +49,7 @@ module RuboCop # @!method method_called?(node) def_node_search :method_called?, '(send nil? %)' - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler return unless example_or_shared_group_or_including?(node) unused_let_bang(node) do |let| diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/message_chain.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/message_chain.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/message_chain.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/message_chain.rb index fc3593cad2..14a09bb3a7 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/message_chain.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/message_chain.rb @@ -9,7 +9,7 @@ module RuboCop # # bad # allow(foo).to receive_message_chain(:bar, :baz).and_return(42) # - # # better + # # good # thing = Thing.new(baz: 42) # allow(foo).to receive(:bar).and_return(thing) # diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/message_expectation.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/message_expectation.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/message_expectation.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/message_expectation.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/message_spies.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/message_spies.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/message_spies.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/message_spies.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/missing_example_group_argument.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/missing_example_group_argument.rb similarity index 89% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/missing_example_group_argument.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/missing_example_group_argument.rb index a29df6f591..4522fde211 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/missing_example_group_argument.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/missing_example_group_argument.rb @@ -19,10 +19,11 @@ module RuboCop # # describe "A feature example" do # end + # class MissingExampleGroupArgument < Base MSG = 'The first argument to `%s` should not be empty.' - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler return unless example_group?(node) return if node.send_node.arguments? diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/comments_help.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/mixin/comments_help.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/comments_help.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/mixin/comments_help.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/mixin/css_selector.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/mixin/css_selector.rb new file mode 100644 index 0000000000..baeb28f4d5 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/mixin/css_selector.rb @@ -0,0 +1,99 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module RSpec + # Helps parsing css selector. + module CssSelector + COMMON_OPTIONS = %w[ + above below left_of right_of near count minimum maximum between text + id class style visible obscured exact exact_text normalize_ws match + wait filter_set focused + ].freeze + + module_function + + # @param selector [String] + # @return [Boolean] + # @example + # id?('#some-id') # => true + # id?('.some-class') # => false + def id?(selector) + selector.start_with?('#') + end + + # @param selector [String] + # @return [Boolean] + # @example + # attribute?('[attribute]') # => true + # attribute?('attribute') # => false + def attribute?(selector) + selector.start_with?('[') + end + + # @param selector [String] + # @return [Array] + # @example + # attributes('a[foo-bar_baz]') # => {"foo-bar_baz=>true} + # attributes('button[foo][bar]') # => {"foo"=>true, "bar"=>true} + # attributes('table[foo=bar]') # => {"foo"=>"'bar'"} + def attributes(selector) + selector.scan(/\[(.*?)\]/).flatten.to_h do |attr| + key, value = attr.split('=') + [key, normalize_value(value)] + end + end + + # @param selector [String] + # @return [Boolean] + # @example + # common_attributes?('a[focused]') # => true + # common_attributes?('button[focused][visible]') # => true + # common_attributes?('table[id=some-id]') # => true + # common_attributes?('h1[invalid]') # => false + def common_attributes?(selector) + attributes(selector).keys.difference(COMMON_OPTIONS).none? + end + + # @param selector [String] + # @return [Array] + # @example + # pseudo_classes('button:not([disabled])') # => ['not()'] + # pseudo_classes('a:enabled:not([valid])') # => ['enabled', 'not()'] + def pseudo_classes(selector) + # Attributes must be excluded or else the colon in the `href`s URL + # will also be picked up as pseudo classes. + # "a:not([href='http://example.com']):enabled" => "a:not():enabled" + ignored_attribute = selector.gsub(/\[.*?\]/, '') + # "a:not():enabled" => ["not()", "enabled"] + ignored_attribute.scan(/:([^:]*)/).flatten + end + + # @param selector [String] + # @return [Boolean] + # @example + # multiple_selectors?('a.cls b#id') # => true + # multiple_selectors?('a.cls') # => false + def multiple_selectors?(selector) + selector.match?(/[ >,+]/) + end + + # @param value [String] + # @return [Boolean, String] + # @example + # normalize_value('true') # => true + # normalize_value('false') # => false + # normalize_value(nil) # => false + # normalize_value("foo") # => "'foo'" + def normalize_value(value) + case value + when 'true' then true + when 'false' then false + when nil then true + else "'#{value}'" + end + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/empty_line_separation.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/mixin/empty_line_separation.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/empty_line_separation.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/mixin/empty_line_separation.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/final_end_location.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/mixin/final_end_location.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/final_end_location.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/mixin/final_end_location.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/inside_example_group.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/mixin/inside_example_group.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/inside_example_group.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/mixin/inside_example_group.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/mixin/namespace.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/mixin/namespace.rb new file mode 100644 index 0000000000..f39555ad5e --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/mixin/namespace.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module RSpec + # Helps to find namespace of the node. + module Namespace + private + + # @param node [RuboCop::AST::Node] + # @return [Array] + # @example + # namespace(node) # => ['A', 'B', 'C'] + def namespace(node) + node + .each_ancestor(:class, :module) + .reverse_each + .flat_map { |ancestor| ancestor.defined_module_name.split('::') } + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/top_level_group.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/mixin/top_level_group.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/top_level_group.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/mixin/top_level_group.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/variable.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/mixin/variable.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/variable.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/mixin/variable.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_describes.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/multiple_describes.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_describes.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/multiple_describes.rb index 20662eeba7..4c231dedc4 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_describes.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/multiple_describes.rb @@ -22,6 +22,7 @@ module RuboCop # describe '.do_something_else' do # end # end + # class MultipleDescribes < Base include TopLevelGroup diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_expectations.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/multiple_expectations.rb similarity index 98% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_expectations.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/multiple_expectations.rb index 33df173fd6..3d3289ef47 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_expectations.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/multiple_expectations.rb @@ -11,7 +11,6 @@ module RuboCop # and works with `--auto-gen-config`. # # @example - # # # bad # describe UserCreator do # it 'builds a user' do @@ -32,7 +31,6 @@ module RuboCop # end # # @example `aggregate_failures: true` (default) - # # # good - the cop ignores when RSpec aggregates failures # describe UserCreator do # it 'builds a user', :aggregate_failures do @@ -42,7 +40,6 @@ module RuboCop # end # # @example `aggregate_failures: false` - # # # Detected as an offense # describe UserCreator do # it 'builds a user', aggregate_failures: false do @@ -52,7 +49,6 @@ module RuboCop # end # # @example configuration - # # # .rubocop.yml # # RSpec/MultipleExpectations: # # Max: 2 @@ -88,7 +84,7 @@ module RuboCop (block (send nil? :aggregate_failures ...) ...) PATTERN - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler return unless example?(node) return if example_with_aggregate_failures?(node) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb similarity index 98% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb index 674b383b93..0e68102bfb 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb @@ -56,7 +56,6 @@ module RuboCop # end # # @example when disabling AllowSubject configuration - # # # rubocop.yml # # RSpec/MultipleMemoizedHelpers: # # AllowSubject: false @@ -72,7 +71,6 @@ module RuboCop # end # # @example with Max configuration - # # # rubocop.yml # # RSpec/MultipleMemoizedHelpers: # # Max: 1 @@ -89,7 +87,7 @@ module RuboCop MSG = 'Example group has too many memoized helpers [%d/%d]' - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler return unless spec_group?(node) count = all_helpers(node).uniq.count diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_subjects.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/multiple_subjects.rb similarity index 83% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_subjects.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/multiple_subjects.rb index 1667748a85..43017ee07a 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_subjects.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/multiple_subjects.rb @@ -6,7 +6,6 @@ module RuboCop # Checks if an example group defines `subject` multiple times. # # @example - # # # bad # describe Foo do # subject(:user) { User.new } @@ -19,6 +18,21 @@ module RuboCop # subject(:post) { Post.new } # end # + # # bad (does not support autocorrection) + # describe Foo do + # subject!(:user) { User.new } + # subject!(:post) { Post.new } + # end + # + # # good + # describe Foo do + # before do + # User.new + # Post.new + # end + # end + # + # This cop does not support autocorrection in some cases. # The autocorrect behavior for this cop depends on the type of # duplication: # @@ -33,13 +47,14 @@ module RuboCop # - If subjects are defined with `subject!` then we don't autocorrect. # This is enough of an edge case that people can just move this to # a `before` hook on their own + # class MultipleSubjects < Base extend AutoCorrector include RangeHelp MSG = 'Do not set more than one subject per example group' - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler return unless example_group?(node) subjects = RuboCop::RSpec::ExampleGroup.new(node).subjects diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/named_subject.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/named_subject.rb similarity index 96% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/named_subject.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/named_subject.rb index 1f18855237..394a71baae 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/named_subject.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/named_subject.rb @@ -41,6 +41,7 @@ module RuboCop # # it { is_expected.to be_valid } # end + # class NamedSubject < Base MSG = 'Name your test subject if you need to reference it explicitly.' @@ -55,7 +56,7 @@ module RuboCop # @!method subject_usage(node) def_node_search :subject_usage, '$(send nil? :subject)' - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler if !example_or_hook_block?(node) || ignored_shared_example?(node) return end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/nested_groups.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/nested_groups.rb similarity index 67% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/nested_groups.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/nested_groups.rb index 53c60ffe64..834324d89b 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/nested_groups.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/nested_groups.rb @@ -36,7 +36,7 @@ module RuboCop # end # end # - # # better + # # good # context 'using some feature as an admin' do # let(:some) { :various } # let(:feature) { :setup } @@ -53,34 +53,40 @@ module RuboCop # it 'yada yada' # end # - # @example configuration - # - # # .rubocop.yml - # # RSpec/NestedGroups: - # # Max: 2 - # - # context 'when using some feature' do - # let(:some) { :various } - # let(:feature) { :setup } - # - # context 'when user is signed in' do - # let(:user) do - # UserCreate.call(user_attributes) + # @example `Max: 3` (default) + # # bad + # describe Foo do + # context 'foo' do + # context 'bar' do + # context 'baz' do # flagged by rubocop + # end # end + # end + # end # - # let(:user_attributes) do - # { - # name: 'John', - # age: 22, - # role: role - # } + # @example `Max: 2` + # # bad + # describe Foo do + # context 'foo' do + # context 'bar' do # flagged by rubocop + # context 'baz' do # flagged by rubocop + # end # end + # end + # end # - # context 'when user is an admin' do # flagged by rubocop - # let(:role) { 'admin' } + # @example `AllowedGroups: [] (default)` + # describe Foo do # <-- nested groups 1 + # context 'foo' do # <-- nested groups 2 + # context 'bar' do # <-- nested groups 3 + # end + # end + # end # - # it 'blah blah' - # it 'yada yada' + # @example `AllowedGroups: [path]` + # describe Foo do # <-- nested groups 1 + # path '/foo' do # <-- nested groups 1 (not counted) + # context 'bar' do # <-- nested groups 2 # end # end # end @@ -113,13 +119,23 @@ module RuboCop example_group = example_group?(node) yield node, nesting if example_group && nesting > max_nesting - next_nesting = example_group ? nesting + 1 : nesting + next_nesting = if count_up_nesting?(node, example_group) + nesting + 1 + else + nesting + end node.each_child_node(:block, :begin) do |child| find_nested_example_groups(child, nesting: next_nesting, &block) end end + def count_up_nesting?(node, example_group) + example_group && + (node.block_type? && + !allowed_groups.include?(node.method_name)) + end + def message(nesting) format(MSG, total: nesting, max: max_nesting) end @@ -136,6 +152,10 @@ module RuboCop cop_config.fetch('Max', 3) end end + + def allowed_groups + @allowed_groups ||= cop_config.fetch('AllowedGroups', []) + end end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/no_expectation_example.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/no_expectation_example.rb new file mode 100644 index 0000000000..f4689698d5 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/no_expectation_example.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module RSpec + # Checks if an example contains any expectation. + # + # All RSpec's example and expectation methods are covered by default. + # If you are using your own custom methods, + # add the following configuration: + # + # RSpec: + # Language: + # Examples: + # Regular: + # - custom_it + # Expectations: + # - custom_expect + # + # @example + # # bad + # it do + # a? + # end + # + # # good + # it do + # expect(a?).to be(true) + # end + # + class NoExpectationExample < Base + MSG = 'No expectation found in this example.' + + # @!method regular_or_focused_example?(node) + # @param [RuboCop::AST::Node] node + # @return [Boolean] + def_node_matcher :regular_or_focused_example?, <<~PATTERN + { + #{block_pattern('{#Examples.regular | #Examples.focused}')} + #{numblock_pattern('{#Examples.regular | #Examples.focused}')} + } + PATTERN + + # @!method including_any_expectation?(node) + # @param [RuboCop::AST::Node] node + # @return [Boolean] + def_node_search( + :including_any_expectation?, + send_pattern('#Expectations.all') + ) + + # @param [RuboCop::AST::BlockNode] node + def on_block(node) + return unless regular_or_focused_example?(node) + return if including_any_expectation?(node) + + add_offense(node) + end + + alias on_numblock on_block + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/not_to_not.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/not_to_not.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/not_to_not.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/not_to_not.rb index d79b4bd2bf..8f09684846 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/not_to_not.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/not_to_not.rb @@ -6,7 +6,6 @@ module RuboCop # Checks for consistent method usage for negating expectations. # # @example `EnforcedStyle: not_to` (default) - # # # bad # it '...' do # expect(false).to_not be_true @@ -18,7 +17,6 @@ module RuboCop # end # # @example `EnforcedStyle: to_not` - # # # bad # it '...' do # expect(false).not_to be_true @@ -28,6 +26,7 @@ module RuboCop # it '...' do # expect(false).to_not be_true # end + # class NotToNot < Base extend AutoCorrector include ConfigurableEnforcedStyle diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/overwriting_setup.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/overwriting_setup.rb similarity index 95% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/overwriting_setup.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/overwriting_setup.rb index 1339755000..c6abc544a3 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/overwriting_setup.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/overwriting_setup.rb @@ -21,6 +21,7 @@ module RuboCop # let(:foo) { bar } # let(:baz) { baz } # let!(:other) { other } + # class OverwritingSetup < Base MSG = '`%s` is already defined.' @@ -30,7 +31,7 @@ module RuboCop # @!method first_argument_name(node) def_node_matcher :first_argument_name, '(send _ _ ({str sym} $_))' - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler return unless example_group_with_body?(node) find_duplicates(node.body) do |duplicate, name| diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/pending.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/pending.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/pending.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/pending.rb index 5a2515560f..c4bbc1da57 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/pending.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/pending.rb @@ -31,6 +31,7 @@ module RuboCop # # good # describe MyClass do # end + # class Pending < Base MSG = 'Pending spec found.' diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/predicate_matcher.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/predicate_matcher.rb index f29ce2d3f5..c0818372b7 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/predicate_matcher.rb @@ -276,6 +276,7 @@ module RuboCop # # # good - the above code is rewritten to it by this cop # expect(foo.something?).to be_truthy + # class PredicateMatcher < Base extend AutoCorrector include ConfigurableEnforcedStyle @@ -291,7 +292,7 @@ module RuboCop end end - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler check_explicit(node) if style == :explicit end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/rails/avoid_setup_hook.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/rails/avoid_setup_hook.rb similarity index 92% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/rails/avoid_setup_hook.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/rails/avoid_setup_hook.rb index 00c1abe88b..49176c69aa 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/rails/avoid_setup_hook.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/rails/avoid_setup_hook.rb @@ -7,7 +7,6 @@ module RuboCop # Checks that tests use RSpec `before` hook over Rails `setup` method. # # @example - # # # bad # setup do # allow(foo).to receive(:bar) @@ -30,7 +29,7 @@ module RuboCop (args) _) PATTERN - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler setup_call(node) do |setup| add_offense(node) do |corrector| corrector.replace setup, 'before' diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/rails/have_http_status.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/rails/have_http_status.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/rails/have_http_status.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/rails/have_http_status.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/rails/http_status.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/rails/http_status.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/rails/http_status.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/rails/http_status.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/receive_counts.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/receive_counts.rb similarity index 73% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/receive_counts.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/receive_counts.rb index 5ad9e590ca..c0d56fa6bf 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/receive_counts.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/receive_counts.rb @@ -6,22 +6,21 @@ module RuboCop # Check for `once` and `twice` receive counts matchers usage. # # @example + # # bad + # expect(foo).to receive(:bar).exactly(1).times + # expect(foo).to receive(:bar).exactly(2).times + # expect(foo).to receive(:bar).at_least(1).times + # expect(foo).to receive(:bar).at_least(2).times + # expect(foo).to receive(:bar).at_most(1).times + # expect(foo).to receive(:bar).at_most(2).times # - # # bad - # expect(foo).to receive(:bar).exactly(1).times - # expect(foo).to receive(:bar).exactly(2).times - # expect(foo).to receive(:bar).at_least(1).times - # expect(foo).to receive(:bar).at_least(2).times - # expect(foo).to receive(:bar).at_most(1).times - # expect(foo).to receive(:bar).at_most(2).times - # - # # good - # expect(foo).to receive(:bar).once - # expect(foo).to receive(:bar).twice - # expect(foo).to receive(:bar).at_least(:once) - # expect(foo).to receive(:bar).at_least(:twice) - # expect(foo).to receive(:bar).at_most(:once) - # expect(foo).to receive(:bar).at_most(:twice).times + # # good + # expect(foo).to receive(:bar).once + # expect(foo).to receive(:bar).twice + # expect(foo).to receive(:bar).at_least(:once) + # expect(foo).to receive(:bar).at_least(:twice) + # expect(foo).to receive(:bar).at_most(:once) + # expect(foo).to receive(:bar).at_most(:twice).times # class ReceiveCounts < Base extend AutoCorrector diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/receive_never.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/receive_never.rb similarity index 87% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/receive_never.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/receive_never.rb index c5538ee583..aeb9f87ad1 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/receive_never.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/receive_never.rb @@ -6,12 +6,11 @@ module RuboCop # Prefer `not_to receive(...)` over `receive(...).never`. # # @example + # # bad + # expect(foo).to receive(:bar).never # - # # bad - # expect(foo).to receive(:bar).never - # - # # good - # expect(foo).not_to receive(:bar) + # # good + # expect(foo).not_to receive(:bar) # class ReceiveNever < Base extend AutoCorrector diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_description.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/repeated_description.rb similarity index 62% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_description.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/repeated_description.rb index f499bb1023..8fcab32f5a 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_description.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/repeated_description.rb @@ -6,44 +6,43 @@ module RuboCop # Check for repeated description strings in example groups. # # @example - # - # # bad - # RSpec.describe User do - # it 'is valid' do - # # ... - # end - # - # it 'is valid' do - # # ... - # end + # # bad + # RSpec.describe User do + # it 'is valid' do + # # ... # end # - # # good - # RSpec.describe User do - # it 'is valid when first and last name are present' do - # # ... - # end + # it 'is valid' do + # # ... + # end + # end # - # it 'is valid when last name only is present' do - # # ... - # end + # # good + # RSpec.describe User do + # it 'is valid when first and last name are present' do + # # ... # end # - # # good - # RSpec.describe User do - # it 'is valid' do - # # ... - # end - # - # it 'is valid', :flag do - # # ... - # end + # it 'is valid when last name only is present' do + # # ... # end + # end + # + # # good + # RSpec.describe User do + # it 'is valid' do + # # ... + # end + # + # it 'is valid', :flag do + # # ... + # end + # end # class RepeatedDescription < Base MSG = "Don't repeat descriptions within an example group." - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler return unless example_group?(node) repeated_descriptions(node).each do |repeated_description| diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/repeated_example.rb similarity index 94% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/repeated_example.rb index 7a7274aade..ce14ba64c2 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/repeated_example.rb @@ -18,7 +18,7 @@ module RuboCop class RepeatedExample < Base MSG = "Don't repeat examples within an example group." - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler return unless example_group?(node) repeated_examples(node).each do |repeated_example| diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example_group_body.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/repeated_example_group_body.rb similarity index 71% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example_group_body.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/repeated_example_group_body.rb index 596d6d61c8..3339546891 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example_group_body.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/repeated_example_group_body.rb @@ -6,42 +6,41 @@ module RuboCop # Check for repeated describe and context block body. # # @example + # # bad + # describe 'cool feature x' do + # it { cool_predicate } + # end # - # # bad - # describe 'cool feature x' do - # it { cool_predicate } - # end + # describe 'cool feature y' do + # it { cool_predicate } + # end # - # describe 'cool feature y' do - # it { cool_predicate } - # end + # # good + # describe 'cool feature' do + # it { cool_predicate } + # end # - # # good - # describe 'cool feature' do - # it { cool_predicate } - # end + # describe 'another cool feature' do + # it { another_predicate } + # end # - # describe 'another cool feature' do - # it { another_predicate } - # end + # # good + # context 'when case x', :tag do + # it { cool_predicate } + # end # - # # good - # context 'when case x', :tag do - # it { cool_predicate } - # end + # context 'when case y' do + # it { cool_predicate } + # end # - # context 'when case y' do - # it { cool_predicate } - # end + # # good + # context Array do + # it { is_expected.to respond_to :each } + # end # - # # good - # context Array do - # it { is_expected.to respond_to :each } - # end - # - # context Hash do - # it { is_expected.to respond_to :each } - # end + # context Hash do + # it { is_expected.to respond_to :each } + # end # class RepeatedExampleGroupBody < Base MSG = 'Repeated %s block body on line(s) %s' diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example_group_description.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/repeated_example_group_description.rb similarity index 72% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example_group_description.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/repeated_example_group_description.rb index b36b18dff3..55777318bb 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example_group_description.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/repeated_example_group_description.rb @@ -6,42 +6,41 @@ module RuboCop # Check for repeated example group descriptions. # # @example + # # bad + # describe 'cool feature' do + # # example group + # end # - # # bad - # describe 'cool feature' do - # # example group - # end + # describe 'cool feature' do + # # example group + # end # - # describe 'cool feature' do - # # example group - # end + # # bad + # context 'when case x' do + # # example group + # end # - # # bad - # context 'when case x' do - # # example group - # end + # describe 'when case x' do + # # example group + # end # - # describe 'when case x' do - # # example group - # end + # # good + # describe 'cool feature' do + # # example group + # end # - # # good - # describe 'cool feature' do - # # example group - # end + # describe 'another cool feature' do + # # example group + # end # - # describe 'another cool feature' do - # # example group - # end + # # good + # context 'when case x' do + # # example group + # end # - # # good - # context 'when case x' do - # # example group - # end - # - # context 'when another case' do - # # example group - # end + # context 'when another case' do + # # example group + # end # class RepeatedExampleGroupDescription < Base MSG = 'Repeated %s block description on line(s) %s' diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_include_example.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/repeated_include_example.rb similarity index 67% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_include_example.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/repeated_include_example.rb index 90baf2b5e8..4e2e03a838 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_include_example.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/repeated_include_example.rb @@ -6,45 +6,44 @@ module RuboCop # Check for repeated include of shared examples. # # @example + # # bad + # describe 'foo' do + # include_examples 'cool stuff' + # include_examples 'cool stuff' + # end # - # # bad - # describe 'foo' do - # include_examples 'cool stuff' - # include_examples 'cool stuff' - # end + # # bad + # describe 'foo' do + # it_behaves_like 'a cool', 'thing' + # it_behaves_like 'a cool', 'thing' + # end # - # # bad - # describe 'foo' do - # it_behaves_like 'a cool', 'thing' - # it_behaves_like 'a cool', 'thing' - # end + # # bad + # context 'foo' do + # it_should_behave_like 'a duck' + # it_should_behave_like 'a duck' + # end # - # # bad - # context 'foo' do - # it_should_behave_like 'a duck' - # it_should_behave_like 'a duck' - # end + # # good + # describe 'foo' do + # include_examples 'cool stuff' + # end # - # # good - # describe 'foo' do - # include_examples 'cool stuff' - # end + # describe 'bar' do + # include_examples 'cool stuff' + # end # - # describe 'bar' do - # include_examples 'cool stuff' - # end + # # good + # describe 'foo' do + # it_behaves_like 'a cool', 'thing' + # it_behaves_like 'a cool', 'person' + # end # - # # good - # describe 'foo' do - # it_behaves_like 'a cool', 'thing' - # it_behaves_like 'a cool', 'person' - # end - # - # # good - # context 'foo' do - # it_should_behave_like 'a duck' - # it_should_behave_like 'a goose' - # end + # # good + # context 'foo' do + # it_should_behave_like 'a duck' + # it_should_behave_like 'a goose' + # end # class RepeatedIncludeExample < Base MSG = 'Repeated include of shared_examples %s ' \ diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/return_from_stub.rb similarity index 98% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/return_from_stub.rb index 759a0d32fc..3c05ef05c8 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/return_from_stub.rb @@ -59,7 +59,7 @@ module RuboCop check_and_return_call(node) end - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler return unless style == :and_return return unless stub_with_block?(node) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/scattered_let.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/scattered_let.rb similarity index 91% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/scattered_let.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/scattered_let.rb index 8644b81e09..9b89c6b182 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/scattered_let.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/scattered_let.rb @@ -31,7 +31,7 @@ module RuboCop MSG = 'Group all let/let! blocks in the example group together.' - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler return unless example_group_with_body?(node) check_let_declarations(node.body) @@ -53,10 +53,6 @@ module RuboCop end end end - - def find_first_let(node) - node.children.find { |child| let?(child) } - end end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/scattered_setup.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/scattered_setup.rb similarity index 95% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/scattered_setup.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/scattered_setup.rb index 58312857b8..aaf117165e 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/scattered_setup.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/scattered_setup.rb @@ -26,7 +26,7 @@ module RuboCop MSG = 'Do not define multiple `%s` hooks in the same ' \ 'example group (also defined on %s).' - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler return unless example_group?(node) repeated_hooks(node).each do |occurrences| diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/shared_context.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/shared_context.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/shared_context.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/shared_context.rb index 0f93f8d157..d30e83eae6 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/shared_context.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/shared_context.rb @@ -79,7 +79,7 @@ module RuboCop def_node_matcher :shared_example, block_pattern('#SharedGroups.examples') - def on_block(node) + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler context_with_only_examples(node) do add_offense(node.send_node, message: MSG_EXAMPLES) do |corrector| corrector.replace(node.send_node.loc.selector, 'shared_examples') diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/shared_examples.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/shared_examples.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/shared_examples.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/shared_examples.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/single_argument_message_chain.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/single_argument_message_chain.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/single_argument_message_chain.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/single_argument_message_chain.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/stubbed_mock.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/stubbed_mock.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/stubbed_mock.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/stubbed_mock.rb index 43646dda66..9d00083d17 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/stubbed_mock.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/stubbed_mock.rb @@ -6,7 +6,6 @@ module RuboCop # Checks that message expectations do not have a configured response. # # @example - # # # bad # expect(foo).to receive(:bar).with(42).and_return("hello world") # diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/subject_declaration.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/subject_declaration.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/subject_declaration.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/subject_declaration.rb index ce4d948a64..47e8b74159 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/subject_declaration.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/subject_declaration.rb @@ -6,7 +6,6 @@ module RuboCop # Ensure that subject is defined using subject helper. # # @example - # # # bad # let(:subject) { foo } # let!(:subject) { foo } diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/subject_stub.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/subject_stub.rb similarity index 96% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/subject_stub.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/subject_stub.rb index 588f184893..3edb2592a7 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/subject_stub.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/subject_stub.rb @@ -11,7 +11,7 @@ module RuboCop # when subject is also defined in parent example groups. # # @see https://robots.thoughtbot.com/don-t-stub-the-system-under-test - # @see https://samphippen.com/introducing-rspec-smells-and-where-to-find-them#smell-1-stubject + # @see https://penelope.zone/2015/12/27/introducing-rspec-smells-and-where-to-find-them.html#smell-1-stubjec # @see https://github.com/rubocop-hq/rspec-style-guide#dont-stub-subject # # @example @@ -72,7 +72,7 @@ module RuboCop def_node_matcher :subject?, <<-PATTERN (block (send nil? - {:subject (sym $_) | $:subject} + { #Subjects.all (sym $_) | $#Subjects.all } ) args ...) PATTERN diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/unspecified_exception.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/unspecified_exception.rb similarity index 70% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/unspecified_exception.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/unspecified_exception.rb index 257aafc281..d169f02c15 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/unspecified_exception.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/unspecified_exception.rb @@ -10,26 +10,26 @@ module RuboCop # to `raise_error` # # @example + # # bad + # expect { + # raise StandardError.new('error') + # }.to raise_error # - # # bad - # expect { - # raise StandardError.new('error') - # }.to raise_error + # # good + # expect { + # raise StandardError.new('error') + # }.to raise_error(StandardError) # - # # good - # expect { - # raise StandardError.new('error') - # }.to raise_error(StandardError) + # expect { + # raise StandardError.new('error') + # }.to raise_error('error') # - # expect { - # raise StandardError.new('error') - # }.to raise_error('error') + # expect { + # raise StandardError.new('error') + # }.to raise_error(/err/) # - # expect { - # raise StandardError.new('error') - # }.to raise_error(/err/) + # expect { do_something }.not_to raise_error # - # expect { do_something }.not_to raise_error class UnspecifiedException < Base MSG = 'Specify the exception being captured' RESTRICT_ON_SEND = %i[to].freeze diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/variable_definition.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/variable_definition.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/variable_definition.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/variable_definition.rb index 3df2fc6d38..089c87ddc6 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/variable_definition.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/variable_definition.rb @@ -22,6 +22,7 @@ module RuboCop # # good # subject('user') { create_user } # let('user_name') { 'Adam' } + # class VariableDefinition < Base extend AutoCorrector include ConfigurableEnforcedStyle diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/variable_name.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/variable_name.rb similarity index 81% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/variable_name.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/variable_name.rb index ed93a6e284..ae5563c1d6 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/variable_name.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/variable_name.rb @@ -5,7 +5,7 @@ module RuboCop module RSpec # Checks that memoized helper names use the configured style. # - # Variables can be excluded from checking using the `IgnoredPatterns` + # Variables can be excluded from checking using the `AllowedPatterns` # option. # # @example EnforcedStyle: snake_case (default) @@ -26,22 +26,21 @@ module RuboCop # subject(:userName1) { 'Adam' } # let(:userName2) { 'Adam' } # - # @example IgnoredPatterns configuration - # + # @example AllowedPatterns configuration # # rubocop.yml # # RSpec/VariableName: # # EnforcedStyle: snake_case - # # IgnoredPatterns: + # # AllowedPatterns: # # - ^userFood # # @example - # # okay because it matches the `^userFood` regex in `IgnoredPatterns` + # # okay because it matches the `^userFood` regex in `AllowedPatterns` # subject(:userFood_1) { 'spaghetti' } # let(:userFood_2) { 'fettuccine' } # class VariableName < Base include ConfigurableNaming - include IgnoredPattern + include AllowedPattern include Variable MSG = 'Use %