From 8a87c6c2028fb7b0a6f207fc033af01b62c1611d Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 2 Nov 2018 08:36:33 +0000 Subject: [PATCH 1/5] RuboCop 0.60.0 --- .gitignore | 4 +- Library/Homebrew/constants.rb | 2 +- Library/Homebrew/vendor/Gemfile.lock | 4 +- .../vendor/bundle-standalone/bundler/setup.rb | 8 +- .../i18n/core_ext/kernel/suppress_warnings.rb | 8 - .../{i18n-1.1.0 => i18n-1.1.1}/lib/i18n.rb | 0 .../lib/i18n/backend.rb | 0 .../lib/i18n/backend/base.rb | 1 - .../lib/i18n/backend/cache.rb | 0 .../lib/i18n/backend/cascade.rb | 0 .../lib/i18n/backend/chain.rb | 0 .../lib/i18n/backend/fallbacks.rb | 0 .../lib/i18n/backend/flatten.rb | 0 .../lib/i18n/backend/gettext.rb | 0 .../i18n/backend/interpolation_compiler.rb | 0 .../lib/i18n/backend/key_value.rb | 0 .../lib/i18n/backend/memoize.rb | 0 .../lib/i18n/backend/metadata.rb | 0 .../lib/i18n/backend/pluralization.rb | 0 .../lib/i18n/backend/simple.rb | 12 +- .../lib/i18n/backend/transliterator.rb | 0 .../lib/i18n/config.rb | 0 .../lib/i18n/core_ext/hash.rb | 0 .../lib/i18n/core_ext/string/interpolate.rb | 9 + .../lib/i18n/exceptions.rb | 0 .../2.3.0/gems/i18n-1.1.1/lib/i18n/gettext.rb | 28 ++ .../i18n-1.1.1/lib/i18n/gettext/helpers.rb | 75 ++++ .../i18n-1.1.1/lib/i18n/gettext/po_parser.rb | 329 +++++++++++++++ .../lib/i18n/interpolate/ruby.rb | 0 .../2.3.0/gems/i18n-1.1.1/lib/i18n/locale.rb | 8 + .../i18n-1.1.1/lib/i18n/locale/fallbacks.rb | 96 +++++ .../gems/i18n-1.1.1/lib/i18n/locale/tag.rb | 28 ++ .../i18n-1.1.1/lib/i18n/locale/tag/parents.rb | 22 + .../i18n-1.1.1/lib/i18n/locale/tag/rfc4646.rb | 74 ++++ .../i18n-1.1.1/lib/i18n/locale/tag/simple.rb | 39 ++ .../gems/i18n-1.1.1/lib/i18n/middleware.rb | 17 + .../2.3.0/gems/i18n-1.1.1/lib/i18n/tests.rb | 14 + .../gems/i18n-1.1.1/lib/i18n/tests/basics.rb | 60 +++ .../i18n-1.1.1/lib/i18n/tests/defaults.rb | 52 +++ .../lib/i18n/tests/interpolation.rb | 159 +++++++ .../gems/i18n-1.1.1/lib/i18n/tests/link.rb | 56 +++ .../i18n-1.1.1/lib/i18n/tests/localization.rb | 19 + .../lib/i18n/tests/localization/date.rb | 95 +++++ .../lib/i18n/tests/localization/date_time.rb | 82 ++++ .../lib/i18n/tests/localization/procs.rb | 116 ++++++ .../lib/i18n/tests/localization/time.rb | 81 ++++ .../gems/i18n-1.1.1/lib/i18n/tests/lookup.rb | 81 ++++ .../lib/i18n/tests/pluralization.rb | 35 ++ .../gems/i18n-1.1.1/lib/i18n/tests/procs.rb | 55 +++ .../lib/i18n/version.rb | 2 +- .../gems/rubocop-rspec-1.30.1/CHANGELOG.md | 391 ++++++++++++++++++ .../2.3.0/gems/rubocop-rspec-1.30.1/Gemfile | 9 + .../gems/rubocop-rspec-1.30.1/MIT-LICENSE.md | 22 + .../2.3.0/gems/rubocop-rspec-1.30.1/README.md | 146 +++++++ .../2.3.0/gems/rubocop-rspec-1.30.1/Rakefile | 85 ++++ .../config/default.yml | 0 .../lib/rubocop-rspec.rb | 0 .../rubocop/cop/rspec/align_left_let_brace.rb | 0 .../cop/rspec/align_right_let_brace.rb | 0 .../lib/rubocop/cop/rspec/any_instance.rb | 0 .../lib/rubocop/cop/rspec/around_block.rb | 0 .../lib/rubocop/cop/rspec/be.rb | 0 .../lib/rubocop/cop/rspec/be_eql.rb | 0 .../lib/rubocop/cop/rspec/before_after_all.rb | 0 .../capybara/current_path_expectation.rb | 0 .../cop/rspec/capybara/feature_methods.rb | 0 .../lib/rubocop/cop/rspec/context_wording.rb | 0 .../lib/rubocop/cop/rspec/cop.rb | 0 .../lib/rubocop/cop/rspec/describe_class.rb | 0 .../lib/rubocop/cop/rspec/describe_method.rb | 0 .../lib/rubocop/cop/rspec/describe_symbol.rb | 0 .../lib/rubocop/cop/rspec/described_class.rb | 0 .../rubocop/cop/rspec/empty_example_group.rb | 0 .../rspec/empty_line_after_example_group.rb | 0 .../cop/rspec/empty_line_after_final_let.rb | 0 .../cop/rspec/empty_line_after_hook.rb | 0 .../cop/rspec/empty_line_after_subject.rb | 0 .../lib/rubocop/cop/rspec/example_length.rb | 0 .../cop/rspec/example_without_description.rb | 0 .../lib/rubocop/cop/rspec/example_wording.rb | 4 +- .../lib/rubocop/cop/rspec/expect_actual.rb | 0 .../lib/rubocop/cop/rspec/expect_change.rb | 0 .../lib/rubocop/cop/rspec/expect_in_hook.rb | 0 .../lib/rubocop/cop/rspec/expect_output.rb | 0 .../attribute_defined_statically.rb | 0 .../cop/rspec/factory_bot/create_list.rb | 5 +- .../lib/rubocop/cop/rspec/file_path.rb | 0 .../lib/rubocop/cop/rspec/focus.rb | 0 .../lib/rubocop/cop/rspec/hook_argument.rb | 0 .../cop/rspec/hooks_before_examples.rb | 0 .../lib/rubocop/cop/rspec/implicit_expect.rb | 0 .../lib/rubocop/cop/rspec/implicit_subject.rb | 0 .../lib/rubocop/cop/rspec/instance_spy.rb | 0 .../rubocop/cop/rspec/instance_variable.rb | 0 .../cop/rspec/invalid_predicate_matcher.rb | 0 .../lib/rubocop/cop/rspec/it_behaves_like.rb | 0 .../rubocop/cop/rspec/iterated_expectation.rb | 0 .../lib/rubocop/cop/rspec/leading_subject.rb | 0 .../rubocop/cop/rspec/let_before_examples.rb | 0 .../lib/rubocop/cop/rspec/let_setup.rb | 0 .../lib/rubocop/cop/rspec/message_chain.rb | 0 .../rubocop/cop/rspec/message_expectation.rb | 0 .../lib/rubocop/cop/rspec/message_spies.rb | 0 .../rspec/missing_example_group_argument.rb | 0 .../rubocop/cop/rspec/multiple_describes.rb | 0 .../cop/rspec/multiple_expectations.rb | 0 .../rubocop/cop/rspec/multiple_subjects.rb | 0 .../lib/rubocop/cop/rspec/named_subject.rb | 0 .../lib/rubocop/cop/rspec/nested_groups.rb | 0 .../lib/rubocop/cop/rspec/not_to_not.rb | 0 .../rubocop/cop/rspec/overwriting_setup.rb | 0 .../lib/rubocop/cop/rspec/pending.rb | 0 .../rubocop/cop/rspec/predicate_matcher.rb | 0 .../rubocop/cop/rspec/rails/http_status.rb | 0 .../lib/rubocop/cop/rspec/receive_counts.rb | 0 .../lib/rubocop/cop/rspec/receive_never.rb | 0 .../rubocop/cop/rspec/repeated_description.rb | 0 .../lib/rubocop/cop/rspec/repeated_example.rb | 0 .../lib/rubocop/cop/rspec/return_from_stub.rb | 0 .../lib/rubocop/cop/rspec/scattered_let.rb | 0 .../lib/rubocop/cop/rspec/scattered_setup.rb | 0 .../lib/rubocop/cop/rspec/shared_context.rb | 0 .../lib/rubocop/cop/rspec/shared_examples.rb | 0 .../rspec/single_argument_message_chain.rb | 0 .../lib/rubocop/cop/rspec/subject_stub.rb | 0 .../cop/rspec/unspecified_exception.rb | 0 .../lib/rubocop/cop/rspec/verified_doubles.rb | 0 .../lib/rubocop/cop/rspec/void_expect.rb | 0 .../lib/rubocop/cop/rspec_cops.rb | 0 .../lib/rubocop/rspec.rb | 0 .../lib/rubocop/rspec/align_let_brace.rb | 0 .../rubocop/rspec/blank_line_separation.rb | 0 .../lib/rubocop/rspec/concept.rb | 0 .../lib/rubocop/rspec/config_formatter.rb | 2 +- .../rubocop/rspec/description_extractor.rb | 0 .../lib/rubocop/rspec/example.rb | 0 .../lib/rubocop/rspec/example_group.rb | 0 .../lib/rubocop/rspec/final_end_location.rb | 0 .../lib/rubocop/rspec/hook.rb | 0 .../lib/rubocop/rspec/inject.rb | 0 .../lib/rubocop/rspec/language.rb | 0 .../rubocop/rspec/language/node_pattern.rb | 0 .../lib/rubocop/rspec/node.rb | 0 .../lib/rubocop/rspec/top_level_describe.rb | 0 .../lib/rubocop/rspec/util.rb | 0 .../lib/rubocop/rspec/version.rb | 2 +- .../lib/rubocop/rspec/wording.rb | 8 +- .../rubocop-rspec.gemspec | 47 +++ .../spec/project/changelog_spec.rb | 74 ++++ .../spec/project/default_config_spec.rb | 74 ++++ .../spec/project/project_requires_spec.rb | 18 + .../cop/rspec/align_left_let_brace_spec.rb | 66 +++ .../cop/rspec/align_right_let_brace_spec.rb | 66 +++ .../rubocop/cop/rspec/any_instance_spec.rb | 30 ++ .../rubocop/cop/rspec/around_block_spec.rb | 119 ++++++ .../spec/rubocop/cop/rspec/be_eql_spec.rb | 60 +++ .../spec/rubocop/cop/rspec/be_spec.rb | 33 ++ .../cop/rspec/before_after_all_spec.rb | 50 +++ .../capybara/current_path_expectation_spec.rb | 29 ++ .../rspec/capybara/feature_methods_spec.rb | 128 ++++++ .../rubocop/cop/rspec/context_wording_spec.rb | 62 +++ .../spec/rubocop/cop/rspec/cop_spec.rb | 95 +++++ .../rubocop/cop/rspec/describe_class_spec.rb | 159 +++++++ .../rubocop/cop/rspec/describe_method_spec.rb | 32 ++ .../rubocop/cop/rspec/describe_symbol_spec.rb | 42 ++ .../rubocop/cop/rspec/described_class_spec.rb | 304 ++++++++++++++ .../cop/rspec/empty_example_group_spec.rb | 93 +++++ .../empty_line_after_example_group_spec.rb | 102 +++++ .../rspec/empty_line_after_final_let_spec.rb | 231 +++++++++++ .../cop/rspec/empty_line_after_hook_spec.rb | 128 ++++++ .../rspec/empty_line_after_subject_spec.rb | 97 +++++ .../rubocop/cop/rspec/example_length_spec.rb | 76 ++++ .../rspec/example_without_description_spec.rb | 90 ++++ .../rubocop/cop/rspec/example_wording_spec.rb | 119 ++++++ .../rubocop/cop/rspec/expect_actual_spec.rb | 150 +++++++ .../rubocop/cop/rspec/expect_change_spec.rb | 78 ++++ .../rubocop/cop/rspec/expect_in_hook_spec.rb | 79 ++++ .../rubocop/cop/rspec/expect_output_spec.rb | 62 +++ .../attribute_defined_statically_spec.rb | 172 ++++++++ .../cop/rspec/factory_bot/create_list_spec.rb | 139 +++++++ .../spec/rubocop/cop/rspec/file_path_spec.rb | 198 +++++++++ .../spec/rubocop/cop/rspec/focus_spec.rb | 131 ++++++ .../rubocop/cop/rspec/hook_argument_spec.rb | 171 ++++++++ .../cop/rspec/hooks_before_examples_spec.rb | 135 ++++++ .../rubocop/cop/rspec/implicit_expect_spec.rb | 101 +++++ .../cop/rspec/implicit_subject_spec.rb | 200 +++++++++ .../rubocop/cop/rspec/instance_spy_spec.rb | 60 +++ .../cop/rspec/instance_variable_spec.rb | 93 +++++ .../rspec/invalid_predicate_matcher_spec.rb | 37 ++ .../rubocop/cop/rspec/it_behaves_like_spec.rb | 49 +++ .../cop/rspec/iterated_expectation_spec.rb | 80 ++++ .../rubocop/cop/rspec/leading_subject_spec.rb | 135 ++++++ .../cop/rspec/let_before_examples_spec.rb | 136 ++++++ .../spec/rubocop/cop/rspec/let_setup_spec.rb | 66 +++ .../rubocop/cop/rspec/message_chain_spec.rb | 21 + .../cop/rspec/message_expectation_spec.rb | 45 ++ .../rubocop/cop/rspec/message_spies_spec.rb | 151 +++++++ .../missing_example_group_argument_spec.rb | 55 +++ .../cop/rspec/multiple_describes_spec.rb | 28 ++ .../cop/rspec/multiple_expectations_spec.rb | 234 +++++++++++ .../cop/rspec/multiple_subjects_spec.rb | 96 +++++ .../rubocop/cop/rspec/named_subject_spec.rb | 62 +++ .../rubocop/cop/rspec/nested_groups_spec.rb | 81 ++++ .../spec/rubocop/cop/rspec/not_to_not_spec.rb | 87 ++++ .../cop/rspec/overwriting_setup_spec.rb | 89 ++++ .../spec/rubocop/cop/rspec/pending_spec.rb | 176 ++++++++ .../cop/rspec/predicate_matcher_spec.rb | 339 +++++++++++++++ .../cop/rspec/rails/http_status_spec.rb | 90 ++++ .../rubocop/cop/rspec/receive_counts_spec.rb | 88 ++++ .../rubocop/cop/rspec/receive_never_spec.rb | 45 ++ .../cop/rspec/repeated_description_spec.rb | 76 ++++ .../cop/rspec/repeated_example_spec.rb | 74 ++++ .../cop/rspec/return_from_stub_spec.rb | 266 ++++++++++++ .../rubocop/cop/rspec/scattered_let_spec.rb | 26 ++ .../rubocop/cop/rspec/scattered_setup_spec.rb | 96 +++++ .../rubocop/cop/rspec/shared_context_spec.rb | 142 +++++++ .../rubocop/cop/rspec/shared_examples_spec.rb | 93 +++++ .../single_argument_message_chain_spec.rb | 138 +++++++ .../rubocop/cop/rspec/subject_stub_spec.rb | 194 +++++++++ .../cop/rspec/unspecified_exception_spec.rb | 175 ++++++++ .../cop/rspec/verified_doubles_spec.rb | 84 ++++ .../rubocop/cop/rspec/void_expect_spec.rb | 47 +++ .../rubocop/rspec/config_formatter_spec.rb | 50 +++ .../rspec/description_extractor_spec.rb | 61 +++ .../spec/rubocop/rspec/example_group_spec.rb | 44 ++ .../spec/rubocop/rspec/example_spec.rb | 62 +++ .../spec/rubocop/rspec/hook_spec.rb | 53 +++ .../rspec/language/selector_set_spec.rb | 51 +++ .../spec/rubocop/rspec/util/one_spec.rb | 21 + .../spec/rubocop/rspec/wording_spec.rb | 50 +++ .../spec/shared/autocorrect_behavior.rb | 7 + .../spec/shared/detects_style_behavior.rb | 7 + .../spec/shared/smoke_test_examples.rb | 25 ++ .../spec/smoke_tests/empty_spec.rb | 0 .../spec/smoke_tests/factory_bot_spec.rb | 11 + .../spec/smoke_tests/no_tests_spec.rb | 4 + .../spec/smoke_tests/weird_rspec_spec.rb | 233 +++++++++++ .../rubocop-rspec-1.30.1/spec/spec_helper.rb | 48 +++ .../spec/support/expect_offense.rb | 17 + 239 files changed, 10849 insertions(+), 34 deletions(-) delete mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/core_ext/kernel/suppress_warnings.rb rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{i18n-1.1.0 => i18n-1.1.1}/lib/i18n.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{i18n-1.1.0 => i18n-1.1.1}/lib/i18n/backend.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{i18n-1.1.0 => i18n-1.1.1}/lib/i18n/backend/base.rb (99%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{i18n-1.1.0 => i18n-1.1.1}/lib/i18n/backend/cache.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{i18n-1.1.0 => i18n-1.1.1}/lib/i18n/backend/cascade.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{i18n-1.1.0 => i18n-1.1.1}/lib/i18n/backend/chain.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{i18n-1.1.0 => i18n-1.1.1}/lib/i18n/backend/fallbacks.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{i18n-1.1.0 => i18n-1.1.1}/lib/i18n/backend/flatten.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{i18n-1.1.0 => i18n-1.1.1}/lib/i18n/backend/gettext.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{i18n-1.1.0 => i18n-1.1.1}/lib/i18n/backend/interpolation_compiler.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{i18n-1.1.0 => i18n-1.1.1}/lib/i18n/backend/key_value.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{i18n-1.1.0 => i18n-1.1.1}/lib/i18n/backend/memoize.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{i18n-1.1.0 => i18n-1.1.1}/lib/i18n/backend/metadata.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{i18n-1.1.0 => i18n-1.1.1}/lib/i18n/backend/pluralization.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{i18n-1.1.0 => i18n-1.1.1}/lib/i18n/backend/simple.rb (94%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{i18n-1.1.0 => i18n-1.1.1}/lib/i18n/backend/transliterator.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{i18n-1.1.0 => i18n-1.1.1}/lib/i18n/config.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{i18n-1.1.0 => i18n-1.1.1}/lib/i18n/core_ext/hash.rb (100%) create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/core_ext/string/interpolate.rb rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{i18n-1.1.0 => i18n-1.1.1}/lib/i18n/exceptions.rb (100%) create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/gettext.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/gettext/helpers.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/gettext/po_parser.rb rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{i18n-1.1.0 => i18n-1.1.1}/lib/i18n/interpolate/ruby.rb (100%) create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/locale.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/locale/fallbacks.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/locale/tag.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/locale/tag/parents.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/locale/tag/rfc4646.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/locale/tag/simple.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/middleware.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/basics.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/defaults.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/interpolation.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/link.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/localization.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/localization/date.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/localization/date_time.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/localization/procs.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/localization/time.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/lookup.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/pluralization.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/procs.rb rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{i18n-1.1.0 => i18n-1.1.1}/lib/i18n/version.rb (70%) create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/CHANGELOG.md create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/Gemfile create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/MIT-LICENSE.md create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/README.md create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/Rakefile rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/config/default.yml (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop-rspec.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/align_left_let_brace.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/align_right_let_brace.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/any_instance.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/around_block.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/be.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/be_eql.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/before_after_all.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/capybara/current_path_expectation.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/capybara/feature_methods.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/context_wording.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/cop.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/describe_class.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/describe_method.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/describe_symbol.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/described_class.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/empty_example_group.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/empty_line_after_example_group.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/empty_line_after_final_let.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/empty_line_after_hook.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/empty_line_after_subject.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/example_length.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/example_without_description.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/example_wording.rb (96%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/expect_actual.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/expect_change.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/expect_in_hook.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/expect_output.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/factory_bot/create_list.rb (96%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/file_path.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/focus.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/hook_argument.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/hooks_before_examples.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/implicit_expect.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/implicit_subject.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/instance_spy.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/instance_variable.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/invalid_predicate_matcher.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/it_behaves_like.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/iterated_expectation.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/leading_subject.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/let_before_examples.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/let_setup.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/message_chain.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/message_expectation.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/message_spies.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/missing_example_group_argument.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/multiple_describes.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/multiple_expectations.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/multiple_subjects.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/named_subject.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/nested_groups.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/not_to_not.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/overwriting_setup.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/pending.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/predicate_matcher.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/rails/http_status.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/receive_counts.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/receive_never.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/repeated_description.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/repeated_example.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/return_from_stub.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/scattered_let.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/scattered_setup.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/shared_context.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/shared_examples.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/single_argument_message_chain.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/subject_stub.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/unspecified_exception.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/verified_doubles.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec/void_expect.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/cop/rspec_cops.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/rspec.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/rspec/align_let_brace.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/rspec/blank_line_separation.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/rspec/concept.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/rspec/config_formatter.rb (93%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/rspec/description_extractor.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/rspec/example.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/rspec/example_group.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/rspec/final_end_location.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/rspec/hook.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/rspec/inject.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/rspec/language.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/rspec/language/node_pattern.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/rspec/node.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/rspec/top_level_describe.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/rspec/util.rb (100%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/rspec/version.rb (83%) rename Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/{rubocop-rspec-1.30.0 => rubocop-rspec-1.30.1}/lib/rubocop/rspec/wording.rb (88%) create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/rubocop-rspec.gemspec create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/project/changelog_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/project/default_config_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/project/project_requires_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/align_left_let_brace_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/align_right_let_brace_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/any_instance_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/around_block_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/be_eql_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/be_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/before_after_all_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/capybara/current_path_expectation_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/capybara/feature_methods_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/context_wording_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/cop_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/describe_class_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/describe_method_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/describe_symbol_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/described_class_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/empty_example_group_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/empty_line_after_example_group_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/empty_line_after_final_let_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/empty_line_after_hook_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/empty_line_after_subject_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/example_length_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/example_without_description_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/example_wording_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/expect_actual_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/expect_change_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/expect_in_hook_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/expect_output_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/factory_bot/attribute_defined_statically_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/factory_bot/create_list_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/file_path_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/focus_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/hook_argument_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/hooks_before_examples_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/implicit_expect_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/implicit_subject_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/instance_spy_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/instance_variable_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/invalid_predicate_matcher_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/it_behaves_like_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/iterated_expectation_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/leading_subject_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/let_before_examples_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/let_setup_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/message_chain_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/message_expectation_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/message_spies_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/missing_example_group_argument_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/multiple_describes_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/multiple_expectations_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/multiple_subjects_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/named_subject_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/nested_groups_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/not_to_not_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/overwriting_setup_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/pending_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/predicate_matcher_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/rails/http_status_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/receive_counts_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/receive_never_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/repeated_description_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/repeated_example_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/return_from_stub_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/scattered_let_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/scattered_setup_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/shared_context_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/shared_examples_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/single_argument_message_chain_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/subject_stub_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/unspecified_exception_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/verified_doubles_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/void_expect_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/config_formatter_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/description_extractor_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/example_group_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/example_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/hook_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/language/selector_set_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/util/one_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/wording_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/shared/autocorrect_behavior.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/shared/detects_style_behavior.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/shared/smoke_test_examples.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/smoke_tests/empty_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/smoke_tests/factory_bot_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/smoke_tests/no_tests_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/smoke_tests/weird_rspec_spec.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/spec_helper.rb create mode 100644 Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/support/expect_offense.rb diff --git a/.gitignore b/.gitignore index 835ed7c172..2fbf17f21f 100644 --- a/.gitignore +++ b/.gitignore @@ -36,10 +36,8 @@ **/vendor/bundle-standalone/ruby/*/gems/activesupport-*/lib **/vendor/bundle-standalone/ruby/*/gems/concurrent-ruby-*/lib **/vendor/bundle-standalone/ruby/*/gems/backports-*/lib -**/vendor/bundle-standalone/ruby/*/gems/i18n-*/lib **/vendor/bundle-standalone/ruby/*/gems/minitest-*/lib **/vendor/bundle-standalone/ruby/*/gems/thread_safe-*/lib -**/vendor/bundle-standalone/ruby/*/gems/tzinfo-*/lib # Ignore rubocop dependencies we don't wish to vendor **/vendor/bundle-standalone/ruby/*/gems/ast-*/ @@ -48,7 +46,7 @@ **/vendor/bundle-standalone/ruby/*/gems/parser-*/ **/vendor/bundle-standalone/ruby/*/gems/powerpack-*/ **/vendor/bundle-standalone/ruby/*/gems/rainbow-*/ -**/vendor/bundle-standalone/ruby/*/gems/rubocop-*/ +**/vendor/bundle-standalone/ruby/*/gems/rubocop-0*/ **/vendor/bundle-standalone/ruby/*/gems/ruby-progressbar-*/ **/vendor/bundle-standalone/ruby/*/gems/unicode-display_width-*/ diff --git a/Library/Homebrew/constants.rb b/Library/Homebrew/constants.rb index 895b12bd3c..57fd418f5b 100644 --- a/Library/Homebrew/constants.rb +++ b/Library/Homebrew/constants.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true # RuboCop version used for `brew style` and `brew cask style` -HOMEBREW_RUBOCOP_VERSION = "0.59.1" +HOMEBREW_RUBOCOP_VERSION = "0.60.0" HOMEBREW_RUBOCOP_CASK_VERSION = "~> 0.22.0" # has to be updated when RuboCop version changes diff --git a/Library/Homebrew/vendor/Gemfile.lock b/Library/Homebrew/vendor/Gemfile.lock index 89eecf1dfd..1097ffe6f6 100644 --- a/Library/Homebrew/vendor/Gemfile.lock +++ b/Library/Homebrew/vendor/Gemfile.lock @@ -9,7 +9,7 @@ GEM ast (2.4.0) backports (3.11.4) concurrent-ruby (1.0.5) - i18n (1.1.0) + i18n (1.1.1) concurrent-ruby (~> 1.0) jaro_winkler (1.5.1) minitest (5.11.3) @@ -44,7 +44,7 @@ DEPENDENCIES backports concurrent-ruby plist - rubocop (= 0.59.1) + rubocop (= 0.60.0) rubocop-rspec ruby-macho diff --git a/Library/Homebrew/vendor/bundle-standalone/bundler/setup.rb b/Library/Homebrew/vendor/bundle-standalone/bundler/setup.rb index e5b194b9c4..7d69ff23d5 100644 --- a/Library/Homebrew/vendor/bundle-standalone/bundler/setup.rb +++ b/Library/Homebrew/vendor/bundle-standalone/bundler/setup.rb @@ -4,7 +4,7 @@ ruby_engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby' ruby_version = RbConfig::CONFIG["ruby_version"] path = File.expand_path('..', __FILE__) $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/concurrent-ruby-1.0.5/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/i18n-1.1.0/lib" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/i18n-1.1.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/minitest-5.11.3/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/thread_safe-0.3.6/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/tzinfo-1.2.5/lib" @@ -15,12 +15,12 @@ $:.unshift "#{path}/" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/universal-darwin-18/2.3.0/jaro_winkler-1.5.1" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/jaro_winkler-1.5.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/parallel-1.12.1/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/parser-2.5.1.2/lib" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/parser-2.5.3.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/plist-3.4.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/powerpack-0.1.2/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rainbow-3.0.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-progressbar-1.10.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/unicode-display_width-1.4.0/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-0.59.1/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-1.30.0/lib" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-0.60.0/lib" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-1.30.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-macho-2.1.0/lib" diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/core_ext/kernel/suppress_warnings.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/core_ext/kernel/suppress_warnings.rb deleted file mode 100644 index eec1435a71..0000000000 --- a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/core_ext/kernel/suppress_warnings.rb +++ /dev/null @@ -1,8 +0,0 @@ -module Kernel - def suppress_warnings - original_verbosity, $VERBOSE = $VERBOSE, nil - yield - ensure - $VERBOSE = original_verbosity - end -end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend/base.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend/base.rb similarity index 99% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend/base.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend/base.rb index c6073d69bf..df619cc5be 100644 --- a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend/base.rb +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend/base.rb @@ -2,7 +2,6 @@ require 'yaml' require 'i18n/core_ext/hash' -require 'i18n/core_ext/kernel/suppress_warnings' module I18n module Backend diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend/cache.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend/cache.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend/cache.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend/cache.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend/cascade.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend/cascade.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend/cascade.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend/cascade.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend/chain.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend/chain.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend/chain.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend/chain.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend/fallbacks.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend/fallbacks.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend/fallbacks.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend/fallbacks.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend/flatten.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend/flatten.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend/flatten.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend/flatten.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend/gettext.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend/gettext.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend/gettext.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend/gettext.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend/interpolation_compiler.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend/interpolation_compiler.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend/interpolation_compiler.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend/interpolation_compiler.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend/key_value.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend/key_value.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend/key_value.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend/key_value.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend/memoize.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend/memoize.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend/memoize.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend/memoize.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend/metadata.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend/metadata.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend/metadata.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend/metadata.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend/pluralization.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend/pluralization.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend/pluralization.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend/pluralization.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend/simple.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend/simple.rb similarity index 94% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend/simple.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend/simple.rb index 48aeaf48a0..231116c12a 100644 --- a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend/simple.rb +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend/simple.rb @@ -59,6 +59,14 @@ module I18n super end + def translations(do_init: false) + # To avoid returning empty translations, + # call `init_translations` + init_translations if do_init && !initialized? + + @translations ||= {} + end + protected def init_translations @@ -66,10 +74,6 @@ module I18n @initialized = true end - def translations - @translations ||= {} - end - # Looks up a translation from the translations hash. Returns nil if # either key is nil, or locale, scope or key do not exist as a key in the # nested translations hash. Splits keys or scopes containing dots diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend/transliterator.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend/transliterator.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/backend/transliterator.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/backend/transliterator.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/config.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/config.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/config.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/config.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/core_ext/hash.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/core_ext/hash.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/core_ext/hash.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/core_ext/hash.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/core_ext/string/interpolate.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/core_ext/string/interpolate.rb new file mode 100644 index 0000000000..a353310bef --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/core_ext/string/interpolate.rb @@ -0,0 +1,9 @@ +# This file used to backport the Ruby 1.9 String interpolation syntax to Ruby 1.8. +# +# Since I18n has dropped support to Ruby 1.8, this file is not required anymore, +# however, Rails 3.2 still requires it directly: +# +# https://github.com/rails/rails/blob/3-2-stable/activesupport/lib/active_support/core_ext/string/interpolation.rb#L2 +# +# So we can't just drop the file entirely, which would then break Rails users +# under Ruby 1.9. This file can be removed once Rails 3.2 support is dropped. diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/exceptions.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/exceptions.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/exceptions.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/exceptions.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/gettext.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/gettext.rb new file mode 100644 index 0000000000..858daff44a --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/gettext.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module I18n + module Gettext + PLURAL_SEPARATOR = "\001" + CONTEXT_SEPARATOR = "\004" + + autoload :Helpers, 'i18n/gettext/helpers' + + @@plural_keys = { :en => [:one, :other] } + + class << self + # returns an array of plural keys for the given locale or the whole hash + # of locale mappings to plural keys so that we can convert from gettext's + # integer-index based style + # TODO move this information to the pluralization module + def plural_keys(*args) + args.empty? ? @@plural_keys : @@plural_keys[args.first] || @@plural_keys[:en] + end + + def extract_scope(msgid, separator) + scope = msgid.to_s.split(separator) + msgid = scope.pop + [scope, msgid] + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/gettext/helpers.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/gettext/helpers.rb new file mode 100644 index 0000000000..309f555e79 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/gettext/helpers.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +require 'i18n/gettext' + +module I18n + module Gettext + # Implements classical Gettext style accessors. To use this include the + # module to the global namespace or wherever you want to use it. + # + # include I18n::Gettext::Helpers + module Helpers + # Makes dynamic translation messages readable for the gettext parser. + # _(fruit) cannot be understood by the gettext parser. To help the parser find all your translations, + # you can add fruit = N_("Apple") which does not translate, but tells the parser: "Apple" needs translation. + # * msgid: the message id. + # * Returns: msgid. + def N_(msgsid) + msgsid + end + + def gettext(msgid, options = EMPTY_HASH) + I18n.t(msgid, { :default => msgid, :separator => '|' }.merge(options)) + end + alias _ gettext + + def sgettext(msgid, separator = '|') + scope, msgid = I18n::Gettext.extract_scope(msgid, separator) + I18n.t(msgid, :scope => scope, :default => msgid, :separator => separator) + end + alias s_ sgettext + + def pgettext(msgctxt, msgid) + separator = I18n::Gettext::CONTEXT_SEPARATOR + sgettext([msgctxt, msgid].join(separator), separator) + end + alias p_ pgettext + + def ngettext(msgid, msgid_plural, n = 1) + nsgettext(msgid, msgid_plural, n) + end + alias n_ ngettext + + # Method signatures: + # nsgettext('Fruits|apple', 'apples', 2) + # nsgettext(['Fruits|apple', 'apples'], 2) + def nsgettext(msgid, msgid_plural, n = 1, separator = '|') + if msgid.is_a?(Array) + msgid, msgid_plural, n, separator = msgid[0], msgid[1], msgid_plural, n + separator = '|' unless separator.is_a?(::String) + end + + scope, msgid = I18n::Gettext.extract_scope(msgid, separator) + default = { :one => msgid, :other => msgid_plural } + I18n.t(msgid, :default => default, :count => n, :scope => scope, :separator => separator) + end + alias ns_ nsgettext + + # Method signatures: + # npgettext('Fruits', 'apple', 'apples', 2) + # npgettext('Fruits', ['apple', 'apples'], 2) + def npgettext(msgctxt, msgid, msgid_plural, n = 1) + separator = I18n::Gettext::CONTEXT_SEPARATOR + + if msgid.is_a?(Array) + msgid_plural, msgid, n = msgid[1], [msgctxt, msgid[0]].join(separator), msgid_plural + else + msgid = [msgctxt, msgid].join(separator) + end + + nsgettext(msgid, msgid_plural, n, separator) + end + alias np_ npgettext + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/gettext/po_parser.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/gettext/po_parser.rb new file mode 100644 index 0000000000..a07fdc5874 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/gettext/po_parser.rb @@ -0,0 +1,329 @@ +=begin + poparser.rb - Generate a .mo + + Copyright (C) 2003-2009 Masao Mutoh + + You may redistribute it and/or modify it under the same + license terms as Ruby. +=end + +#MODIFIED +# removed include GetText etc +# added stub translation method _(x) +require 'racc/parser' + +module GetText + + class PoParser < Racc::Parser + + def _(x) + x + end + +module_eval <<'..end src/poparser.ry modeval..id7a99570e05', 'src/poparser.ry', 108 + def unescape(orig) + ret = orig.gsub(/\\n/, "\n") + ret.gsub!(/\\t/, "\t") + ret.gsub!(/\\r/, "\r") + ret.gsub!(/\\"/, "\"") + ret + end + + def parse(str, data, ignore_fuzzy = true) + @comments = [] + @data = data + @fuzzy = false + @msgctxt = "" + $ignore_fuzzy = ignore_fuzzy + + str.strip! + @q = [] + until str.empty? do + case str + when /\A\s+/ + str = $' + when /\Amsgctxt/ + @q.push [:MSGCTXT, $&] + str = $' + when /\Amsgid_plural/ + @q.push [:MSGID_PLURAL, $&] + str = $' + when /\Amsgid/ + @q.push [:MSGID, $&] + str = $' + when /\Amsgstr/ + @q.push [:MSGSTR, $&] + str = $' + when /\A\[(\d+)\]/ + @q.push [:PLURAL_NUM, $1] + str = $' + when /\A\#~(.*)/ + $stderr.print _("Warning: obsolete msgid exists.\n") + $stderr.print " #{$&}\n" + @q.push [:COMMENT, $&] + str = $' + when /\A\#(.*)/ + @q.push [:COMMENT, $&] + str = $' + when /\A\"(.*)\"/ + @q.push [:STRING, $1] + str = $' + else + #c = str[0,1] + #@q.push [:STRING, c] + str = str[1..-1] + end + end + @q.push [false, '$end'] + if $DEBUG + @q.each do |a,b| + puts "[#{a}, #{b}]" + end + end + @yydebug = true if $DEBUG + do_parse + + if @comments.size > 0 + @data.set_comment(:last, @comments.join("\n")) + end + @data + end + + def next_token + @q.shift + end + + def on_message(msgid, msgstr) + if msgstr.size > 0 + @data[msgid] = msgstr + @data.set_comment(msgid, @comments.join("\n")) + end + @comments.clear + @msgctxt = "" + end + + def on_comment(comment) + @fuzzy = true if (/fuzzy/ =~ comment) + @comments << comment + end + + +..end src/poparser.ry modeval..id7a99570e05 + +##### racc 1.4.5 generates ### + +racc_reduce_table = [ + 0, 0, :racc_error, + 0, 10, :_reduce_none, + 2, 10, :_reduce_none, + 2, 10, :_reduce_none, + 2, 10, :_reduce_none, + 2, 12, :_reduce_5, + 1, 13, :_reduce_none, + 1, 13, :_reduce_none, + 4, 15, :_reduce_8, + 5, 16, :_reduce_9, + 2, 17, :_reduce_10, + 1, 17, :_reduce_none, + 3, 18, :_reduce_12, + 1, 11, :_reduce_13, + 2, 14, :_reduce_14, + 1, 14, :_reduce_15 ] + +racc_reduce_n = 16 + +racc_shift_n = 26 + +racc_action_table = [ + 3, 13, 5, 7, 9, 15, 16, 17, 20, 17, + 13, 17, 13, 13, 11, 17, 23, 20, 13, 17 ] + +racc_action_check = [ + 1, 16, 1, 1, 1, 12, 12, 12, 18, 18, + 7, 14, 15, 9, 3, 19, 20, 21, 23, 25 ] + +racc_action_pointer = [ + nil, 0, nil, 14, nil, nil, nil, 3, nil, 6, + nil, nil, 0, nil, 4, 5, -6, nil, 2, 8, + 8, 11, nil, 11, nil, 12 ] + +racc_action_default = [ + -1, -16, -2, -16, -3, -13, -4, -16, -6, -16, + -7, 26, -16, -15, -5, -16, -16, -14, -16, -8, + -16, -9, -11, -16, -10, -12 ] + +racc_goto_table = [ + 12, 22, 14, 4, 24, 6, 2, 8, 18, 19, + 10, 21, 1, nil, nil, nil, 25 ] + +racc_goto_check = [ + 5, 9, 5, 3, 9, 4, 2, 6, 5, 5, + 7, 8, 1, nil, nil, nil, 5 ] + +racc_goto_pointer = [ + nil, 12, 5, 2, 4, -7, 6, 9, -7, -17 ] + +racc_goto_default = [ + nil, nil, nil, nil, nil, nil, nil, nil, nil, nil ] + +racc_token_table = { + false => 0, + Object.new => 1, + :COMMENT => 2, + :MSGID => 3, + :MSGCTXT => 4, + :MSGID_PLURAL => 5, + :MSGSTR => 6, + :STRING => 7, + :PLURAL_NUM => 8 } + +racc_use_result_var = true + +racc_nt_base = 9 + +Racc_arg = [ + racc_action_table, + racc_action_check, + racc_action_default, + racc_action_pointer, + racc_goto_table, + racc_goto_check, + racc_goto_default, + racc_goto_pointer, + racc_nt_base, + racc_reduce_table, + racc_token_table, + racc_shift_n, + racc_reduce_n, + racc_use_result_var ] + +Racc_token_to_s_table = [ +'$end', +'error', +'COMMENT', +'MSGID', +'MSGCTXT', +'MSGID_PLURAL', +'MSGSTR', +'STRING', +'PLURAL_NUM', +'$start', +'msgfmt', +'comment', +'msgctxt', +'message', +'string_list', +'single_message', +'plural_message', +'msgstr_plural', +'msgstr_plural_line'] + +Racc_debug_parser = true + +##### racc system variables end ##### + + # reduce 0 omitted + + # reduce 1 omitted + + # reduce 2 omitted + + # reduce 3 omitted + + # reduce 4 omitted + +module_eval <<'.,.,', 'src/poparser.ry', 25 + def _reduce_5( val, _values, result ) + @msgctxt = unescape(val[1]) + "\004" + result + end +.,., + + # reduce 6 omitted + + # reduce 7 omitted + +module_eval <<'.,.,', 'src/poparser.ry', 48 + def _reduce_8( val, _values, result ) + if @fuzzy and $ignore_fuzzy + if val[1] != "" + $stderr.print _("Warning: fuzzy message was ignored.\n") + $stderr.print " msgid '#{val[1]}'\n" + else + on_message('', unescape(val[3])) + end + @fuzzy = false + else + on_message(@msgctxt + unescape(val[1]), unescape(val[3])) + end + result = "" + result + end +.,., + +module_eval <<'.,.,', 'src/poparser.ry', 65 + def _reduce_9( val, _values, result ) + if @fuzzy and $ignore_fuzzy + if val[1] != "" + $stderr.print _("Warning: fuzzy message was ignored.\n") + $stderr.print "msgid = '#{val[1]}\n" + else + on_message('', unescape(val[3])) + end + @fuzzy = false + else + on_message(@msgctxt + unescape(val[1]) + "\000" + unescape(val[3]), unescape(val[4])) + end + result = "" + result + end +.,., + +module_eval <<'.,.,', 'src/poparser.ry', 76 + def _reduce_10( val, _values, result ) + if val[0].size > 0 + result = val[0] + "\000" + val[1] + else + result = "" + end + result + end +.,., + + # reduce 11 omitted + +module_eval <<'.,.,', 'src/poparser.ry', 84 + def _reduce_12( val, _values, result ) + result = val[2] + result + end +.,., + +module_eval <<'.,.,', 'src/poparser.ry', 91 + def _reduce_13( val, _values, result ) + on_comment(val[0]) + result + end +.,., + +module_eval <<'.,.,', 'src/poparser.ry', 99 + def _reduce_14( val, _values, result ) + result = val.delete_if{|item| item == ""}.join + result + end +.,., + +module_eval <<'.,.,', 'src/poparser.ry', 103 + def _reduce_15( val, _values, result ) + result = val[0] + result + end +.,., + + def _reduce_none( val, _values, result ) + result + end + + end # class PoParser + +end # module GetText diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/interpolate/ruby.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/interpolate/ruby.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/interpolate/ruby.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/interpolate/ruby.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/locale.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/locale.rb new file mode 100644 index 0000000000..c4078e614b --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/locale.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +module I18n + module Locale + autoload :Fallbacks, 'i18n/locale/fallbacks' + autoload :Tag, 'i18n/locale/tag' + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/locale/fallbacks.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/locale/fallbacks.rb new file mode 100644 index 0000000000..83f2a5e9ca --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/locale/fallbacks.rb @@ -0,0 +1,96 @@ +# Locale Fallbacks +# +# Extends the I18n module to hold a fallbacks instance which is set to an +# instance of I18n::Locale::Fallbacks by default but can be swapped with a +# different implementation. +# +# Locale fallbacks will compute a number of fallback locales for a given locale. +# For example: +# +#

+# I18n.fallbacks[:"es-MX"] # => [:"es-MX", :es, :en] 
+# +# Locale fallbacks always fall back to +# +# * all parent locales of a given locale (e.g. :es for :"es-MX") first, +# * the current default locales and all of their parents second +# +# The default locales are set to [I18n.default_locale] by default but can be +# set to something else. +# +# One can additionally add any number of additional fallback locales manually. +# These will be added before the default locales to the fallback chain. For +# example: +# +# # using the default locale as default fallback locale +# +# I18n.default_locale = :"en-US" +# I18n.fallbacks = I18n::Locale::Fallbacks.new(:"de-AT" => :"de-DE") +# I18n.fallbacks[:"de-AT"] # => [:"de-AT", :"de-DE", :de, :"en-US", :en] +# +# # using a custom locale as default fallback locale +# +# I18n.fallbacks = I18n::Locale::Fallbacks.new(:"en-GB", :"de-AT" => :de, :"de-CH" => :de) +# I18n.fallbacks[:"de-AT"] # => [:"de-AT", :de, :"en-GB", :en] +# I18n.fallbacks[:"de-CH"] # => [:"de-CH", :de, :"en-GB", :en] +# +# # mapping fallbacks to an existing instance +# +# # people speaking Catalan also speak Spanish as spoken in Spain +# fallbacks = I18n.fallbacks +# fallbacks.map(:ca => :"es-ES") +# fallbacks[:ca] # => [:ca, :"es-ES", :es, :"en-US", :en] +# +# # people speaking Arabian as spoken in Palestine also speak Hebrew as spoken in Israel +# fallbacks.map(:"ar-PS" => :"he-IL") +# fallbacks[:"ar-PS"] # => [:"ar-PS", :ar, :"he-IL", :he, :"en-US", :en] +# fallbacks[:"ar-EG"] # => [:"ar-EG", :ar, :"en-US", :en] +# +# # people speaking Sami as spoken in Finnland also speak Swedish and Finnish as spoken in Finnland +# fallbacks.map(:sms => [:"se-FI", :"fi-FI"]) +# fallbacks[:sms] # => [:sms, :"se-FI", :se, :"fi-FI", :fi, :"en-US", :en] + +module I18n + module Locale + class Fallbacks < Hash + def initialize(*mappings) + @map = {} + map(mappings.pop) if mappings.last.is_a?(Hash) + self.defaults = mappings.empty? ? [] : mappings + end + + def defaults=(defaults) + @defaults = defaults.map { |default| compute(default, false) }.flatten + end + attr_reader :defaults + + def [](locale) + raise InvalidLocale.new(locale) if locale.nil? + locale = locale.to_sym + super || store(locale, compute(locale)) + end + + def map(mappings) + mappings.each do |from, to| + from, to = from.to_sym, Array(to) + to.each do |_to| + @map[from] ||= [] + @map[from] << _to.to_sym + end + end + end + + protected + + def compute(tags, include_defaults = true, exclude = []) + result = Array(tags).collect do |tag| + tags = I18n::Locale::Tag.tag(tag).self_and_parents.map! { |t| t.to_sym } - exclude + tags.each { |_tag| tags += compute(@map[_tag], false, exclude + tags) if @map[_tag] } + tags + end.flatten + result.push(*defaults) if include_defaults + result.uniq.compact + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/locale/tag.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/locale/tag.rb new file mode 100644 index 0000000000..a640b4465f --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/locale/tag.rb @@ -0,0 +1,28 @@ +# encoding: utf-8 + +module I18n + module Locale + module Tag + autoload :Parents, 'i18n/locale/tag/parents' + autoload :Rfc4646, 'i18n/locale/tag/rfc4646' + autoload :Simple, 'i18n/locale/tag/simple' + + class << self + # Returns the current locale tag implementation. Defaults to +I18n::Locale::Tag::Simple+. + def implementation + @@implementation ||= Simple + end + + # Sets the current locale tag implementation. Use this to set a different locale tag implementation. + def implementation=(implementation) + @@implementation = implementation + end + + # Factory method for locale tags. Delegates to the current locale tag implementation. + def tag(tag) + implementation.tag(tag) + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/locale/tag/parents.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/locale/tag/parents.rb new file mode 100644 index 0000000000..ec53060f9c --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/locale/tag/parents.rb @@ -0,0 +1,22 @@ +module I18n + module Locale + module Tag + module Parents + def parent + @parent ||= begin + segs = to_a.compact + segs.length > 1 ? self.class.tag(*segs[0..(segs.length-2)].join('-')) : nil + end + end + + def self_and_parents + @self_and_parents ||= [self] + parents + end + + def parents + @parents ||= ([parent] + (parent ? parent.parents : [])).compact + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/locale/tag/rfc4646.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/locale/tag/rfc4646.rb new file mode 100644 index 0000000000..4ce4c751ae --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/locale/tag/rfc4646.rb @@ -0,0 +1,74 @@ +# RFC 4646/47 compliant Locale tag implementation that parses locale tags to +# subtags such as language, script, region, variant etc. +# +# For more information see by http://en.wikipedia.org/wiki/IETF_language_tag +# +# Rfc4646::Parser does not implement grandfathered tags. + +module I18n + module Locale + module Tag + RFC4646_SUBTAGS = [ :language, :script, :region, :variant, :extension, :privateuse, :grandfathered ] + RFC4646_FORMATS = { :language => :downcase, :script => :capitalize, :region => :upcase, :variant => :downcase } + + class Rfc4646 < Struct.new(*RFC4646_SUBTAGS) + class << self + # Parses the given tag and returns a Tag instance if it is valid. + # Returns false if the given tag is not valid according to RFC 4646. + def tag(tag) + matches = parser.match(tag) + new(*matches) if matches + end + + def parser + @@parser ||= Rfc4646::Parser + end + + def parser=(parser) + @@parser = parser + end + end + + include Parents + + RFC4646_FORMATS.each do |name, format| + define_method(name) { self[name].send(format) unless self[name].nil? } + end + + def to_sym + to_s.to_sym + end + + def to_s + @tag ||= to_a.compact.join("-") + end + + def to_a + members.collect { |attr| self.send(attr) } + end + + module Parser + PATTERN = %r{\A(?: + ([a-z]{2,3}(?:(?:-[a-z]{3}){0,3})?|[a-z]{4}|[a-z]{5,8}) # language + (?:-([a-z]{4}))? # script + (?:-([a-z]{2}|\d{3}))? # region + (?:-([0-9a-z]{5,8}|\d[0-9a-z]{3}))* # variant + (?:-([0-9a-wyz](?:-[0-9a-z]{2,8})+))* # extension + (?:-(x(?:-[0-9a-z]{1,8})+))?| # privateuse subtag + (x(?:-[0-9a-z]{1,8})+)| # privateuse tag + /* ([a-z]{1,3}(?:-[0-9a-z]{2,8}){1,2}) */ # grandfathered + )\z}xi + + class << self + def match(tag) + c = PATTERN.match(tag.to_s).captures + c[0..4] << (c[5].nil? ? c[6] : c[5]) << c[7] # TODO c[7] is grandfathered, throw a NotImplemented exception here? + rescue + false + end + end + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/locale/tag/simple.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/locale/tag/simple.rb new file mode 100644 index 0000000000..68642a123f --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/locale/tag/simple.rb @@ -0,0 +1,39 @@ +# Simple Locale tag implementation that computes subtags by simply splitting +# the locale tag at '-' occurences. +module I18n + module Locale + module Tag + class Simple + class << self + def tag(tag) + new(tag) + end + end + + include Parents + + attr_reader :tag + + def initialize(*tag) + @tag = tag.join('-').to_sym + end + + def subtags + @subtags = tag.to_s.split('-').map { |subtag| subtag.to_s } + end + + def to_sym + tag + end + + def to_s + tag.to_s + end + + def to_a + subtags + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/middleware.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/middleware.rb new file mode 100644 index 0000000000..59b377e280 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/middleware.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module I18n + class Middleware + + def initialize(app) + @app = app + end + + def call(env) + @app.call(env) + ensure + Thread.current[:i18n_config] = I18n::Config.new + end + + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests.rb new file mode 100644 index 0000000000..30d0ed53bf --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module I18n + module Tests + autoload :Basics, 'i18n/tests/basics' + autoload :Defaults, 'i18n/tests/defaults' + autoload :Interpolation, 'i18n/tests/interpolation' + autoload :Link, 'i18n/tests/link' + autoload :Localization, 'i18n/tests/localization' + autoload :Lookup, 'i18n/tests/lookup' + autoload :Pluralization, 'i18n/tests/pluralization' + autoload :Procs, 'i18n/tests/procs' + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/basics.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/basics.rb new file mode 100644 index 0000000000..951d7ab5db --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/basics.rb @@ -0,0 +1,60 @@ +module I18n + module Tests + module Basics + def teardown + I18n.available_locales = nil + end + + test "available_locales returns the locales stored to the backend by default" do + I18n.backend.store_translations('de', :foo => 'bar') + I18n.backend.store_translations('en', :foo => 'foo') + + assert I18n.available_locales.include?(:de) + assert I18n.available_locales.include?(:en) + end + + test "available_locales can be set to something else independently from the actual locale data" do + I18n.backend.store_translations('de', :foo => 'bar') + I18n.backend.store_translations('en', :foo => 'foo') + + I18n.available_locales = :foo + assert_equal [:foo], I18n.available_locales + + I18n.available_locales = [:foo, 'bar'] + assert_equal [:foo, :bar], I18n.available_locales + + I18n.available_locales = nil + assert I18n.available_locales.include?(:de) + assert I18n.available_locales.include?(:en) + end + + test "available_locales memoizes when set explicitely" do + I18n.backend.expects(:available_locales).never + I18n.available_locales = [:foo] + I18n.backend.store_translations('de', :bar => 'baz') + I18n.reload! + assert_equal [:foo], I18n.available_locales + end + + test "available_locales delegates to the backend when not set explicitely" do + original_available_locales_value = I18n.backend.available_locales + I18n.backend.expects(:available_locales).returns(original_available_locales_value).twice + assert_equal I18n.backend.available_locales, I18n.available_locales + end + + test "exists? is implemented by the backend" do + I18n.backend.store_translations(:foo, :bar => 'baz') + assert I18n.exists?(:bar, :foo) + end + + test "storing a nil value as a translation removes it from the available locale data" do + I18n.backend.store_translations(:en, :to_be_deleted => 'bar') + assert_equal 'bar', I18n.t(:to_be_deleted, :default => 'baz') + + I18n.cache_store.clear if I18n.respond_to?(:cache_store) && I18n.cache_store + I18n.backend.store_translations(:en, :to_be_deleted => nil) + assert_equal 'baz', I18n.t(:to_be_deleted, :default => 'baz') + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/defaults.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/defaults.rb new file mode 100644 index 0000000000..b46af61f0d --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/defaults.rb @@ -0,0 +1,52 @@ +# encoding: utf-8 + +module I18n + module Tests + module Defaults + def setup + super + I18n.backend.store_translations(:en, :foo => { :bar => 'bar', :baz => 'baz' }) + end + + test "defaults: given nil as a key it returns the given default" do + assert_equal 'default', I18n.t(nil, :default => 'default') + end + + test "defaults: given a symbol as a default it translates the symbol" do + assert_equal 'bar', I18n.t(nil, :default => :'foo.bar') + end + + test "defaults: given a symbol as a default and a scope it stays inside the scope when looking up the symbol" do + assert_equal 'bar', I18n.t(:missing, :default => :bar, :scope => :foo) + end + + test "defaults: given an array as a default it returns the first match" do + assert_equal 'bar', I18n.t(:does_not_exist, :default => [:does_not_exist_2, :'foo.bar']) + end + + test "defaults: given an array as a default with false it returns false" do + assert_equal false, I18n.t(:does_not_exist, :default => [false]) + end + + test "defaults: given false it returns false" do + assert_equal false, I18n.t(:does_not_exist, :default => false) + end + + test "defaults: given nil it returns nil" do + assert_nil I18n.t(:does_not_exist, :default => nil) + end + + test "defaults: given an array of missing keys it raises a MissingTranslationData exception" do + assert_raise I18n::MissingTranslationData do + I18n.t(:does_not_exist, :default => [:does_not_exist_2, :does_not_exist_3], :raise => true) + end + end + + test "defaults: using a custom scope separator" do + # data must have been stored using the custom separator when using the ActiveRecord backend + I18n.backend.store_translations(:en, { :foo => { :bar => 'bar' } }, { :separator => '|' }) + assert_equal 'bar', I18n.t(nil, :default => :'foo|bar', :separator => '|') + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/interpolation.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/interpolation.rb new file mode 100644 index 0000000000..c5d140a918 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/interpolation.rb @@ -0,0 +1,159 @@ +# encoding: utf-8 + +module I18n + module Tests + module Interpolation + # If no interpolation parameter is not given, I18n should not alter the string. + # This behavior is due to three reasons: + # + # * Checking interpolation keys in all strings hits performance, badly; + # + # * This allows us to retrieve untouched values through I18n. For example + # I could have a middleware that returns I18n lookup results in JSON + # to be processed through Javascript. Leaving the keys untouched allows + # the interpolation to happen at the javascript level; + # + # * Security concerns: if I allow users to translate a web site, they can + # insert %{} in messages causing the I18n lookup to fail in every request. + # + test "interpolation: given no values it does not alter the string" do + assert_equal 'Hi %{name}!', interpolate(:default => 'Hi %{name}!') + end + + test "interpolation: given values it interpolates them into the string" do + assert_equal 'Hi David!', interpolate(:default => 'Hi %{name}!', :name => 'David') + end + + test "interpolation: given a nil value it still interpolates it into the string" do + assert_equal 'Hi !', interpolate(:default => 'Hi %{name}!', :name => nil) + end + + test "interpolation: given a lambda as a value it calls it if the string contains the key" do + assert_equal 'Hi David!', interpolate(:default => 'Hi %{name}!', :name => lambda { |*args| 'David' }) + end + + test "interpolation: given a lambda as a value it does not call it if the string does not contain the key" do + assert_nothing_raised { interpolate(:default => 'Hi!', :name => lambda { |*args| raise 'fail' }) } + end + + test "interpolation: given values but missing a key it raises I18n::MissingInterpolationArgument" do + assert_raise(I18n::MissingInterpolationArgument) do + interpolate(:default => '%{foo}', :bar => 'bar') + end + end + + test "interpolation: it does not raise I18n::MissingInterpolationArgument for escaped variables" do + assert_nothing_raised do + assert_equal 'Barr %{foo}', interpolate(:default => '%{bar} %%{foo}', :bar => 'Barr') + end + end + + test "interpolation: it does not change the original, stored translation string" do + I18n.backend.store_translations(:en, :interpolate => 'Hi %{name}!') + assert_equal 'Hi David!', interpolate(:interpolate, :name => 'David') + assert_equal 'Hi Yehuda!', interpolate(:interpolate, :name => 'Yehuda') + end + + test "interpolation: given an array interpolates each element" do + I18n.backend.store_translations(:en, :array_interpolate => ['Hi', 'Mr. %{name}', 'or sir %{name}']) + assert_equal ['Hi', 'Mr. Bartuz', 'or sir Bartuz'], interpolate(:array_interpolate, :name => 'Bartuz') + end + + test "interpolation: given the translation is in utf-8 it still works" do + assert_equal 'Häi David!', interpolate(:default => 'Häi %{name}!', :name => 'David') + end + + test "interpolation: given the value is in utf-8 it still works" do + assert_equal 'Hi ゆきひろ!', interpolate(:default => 'Hi %{name}!', :name => 'ゆきひろ') + end + + test "interpolation: given the translation and the value are in utf-8 it still works" do + assert_equal 'こんにちは、ゆきひろさん!', interpolate(:default => 'こんにちは、%{name}さん!', :name => 'ゆきひろ') + end + + if Object.const_defined?(:Encoding) + test "interpolation: given a euc-jp translation and a utf-8 value it raises Encoding::CompatibilityError" do + assert_raise(Encoding::CompatibilityError) do + interpolate(:default => euc_jp('こんにちは、%{name}さん!'), :name => 'ゆきひろ') + end + end + + test "interpolation: given a utf-8 translation and a euc-jp value it raises Encoding::CompatibilityError" do + assert_raise(Encoding::CompatibilityError) do + interpolate(:default => 'こんにちは、%{name}さん!', :name => euc_jp('ゆきひろ')) + end + end + + test "interpolation: ASCII strings in the backend should be encoded to UTF8 if interpolation options are in UTF8" do + I18n.backend.store_translations 'en', 'encoding' => ('%{who} let me go'.force_encoding("ASCII")) + result = I18n.t 'encoding', :who => "måmmå miå" + assert_equal Encoding::UTF_8, result.encoding + end + + test "interpolation: UTF8 strings in the backend are still returned as UTF8 with ASCII interpolation" do + I18n.backend.store_translations 'en', 'encoding' => 'måmmå miå %{what}' + result = I18n.t 'encoding', :what => 'let me go'.force_encoding("ASCII") + assert_equal Encoding::UTF_8, result.encoding + end + + test "interpolation: UTF8 strings in the backend are still returned as UTF8 even with numbers interpolation" do + I18n.backend.store_translations 'en', 'encoding' => '%{count} times: måmmå miå' + result = I18n.t 'encoding', :count => 3 + assert_equal Encoding::UTF_8, result.encoding + end + end + + test "interpolation: given a translations containing a reserved key it raises I18n::ReservedInterpolationKey" do + assert_raise(I18n::ReservedInterpolationKey) { interpolate(:foo => :bar, :default => '%{exception_handler}') } + assert_raise(I18n::ReservedInterpolationKey) { interpolate(:foo => :bar, :default => '%{default}') } + assert_raise(I18n::ReservedInterpolationKey) { interpolate(:foo => :bar, :default => '%{separator}') } + assert_raise(I18n::ReservedInterpolationKey) { interpolate(:foo => :bar, :default => '%{scope}') } + end + + test "interpolation: deep interpolation for default string" do + assert_equal 'Hi %{name}!', interpolate(:default => 'Hi %{name}!', :deep_interpolation => true) + end + + test "interpolation: deep interpolation for interpolated string" do + assert_equal 'Hi Ann!', interpolate(:default => 'Hi %{name}!', :name => 'Ann', :deep_interpolation => true) + end + + test "interpolation: deep interpolation for Hash" do + people = { :people => { :ann => 'Ann is %{ann}', :john => 'John is %{john}' } } + interpolated_people = { :people => { :ann => 'Ann is good', :john => 'John is big' } } + assert_equal interpolated_people, interpolate(:default => people, :ann => 'good', :john => 'big', :deep_interpolation => true) + end + + test "interpolation: deep interpolation for Array" do + people = { :people => ['Ann is %{ann}', 'John is %{john}'] } + interpolated_people = { :people => ['Ann is good', 'John is big'] } + assert_equal interpolated_people, interpolate(:default => people, :ann => 'good', :john => 'big', :deep_interpolation => true) + end + + protected + + def capture(stream) + begin + stream = stream.to_s + eval "$#{stream} = StringIO.new" + yield + result = eval("$#{stream}").string + ensure + eval("$#{stream} = #{stream.upcase}") + end + + result + end + + def euc_jp(string) + string.encode!(Encoding::EUC_JP) + end + + def interpolate(*args) + options = args.last.is_a?(Hash) ? args.pop : {} + key = args.pop + I18n.backend.translate('en', key, options) + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/link.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/link.rb new file mode 100644 index 0000000000..da84a2c843 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/link.rb @@ -0,0 +1,56 @@ +# encoding: utf-8 + +module I18n + module Tests + module Link + test "linked lookup: if a key resolves to a symbol it looks up the symbol" do + I18n.backend.store_translations 'en', { + :link => :linked, + :linked => 'linked' + } + assert_equal 'linked', I18n.backend.translate('en', :link) + end + + test "linked lookup: if a key resolves to a dot-separated symbol it looks up the symbol" do + I18n.backend.store_translations 'en', { + :link => :"foo.linked", + :foo => { :linked => 'linked' } + } + assert_equal('linked', I18n.backend.translate('en', :link)) + end + + test "linked lookup: if a dot-separated key resolves to a symbol it looks up the symbol" do + I18n.backend.store_translations 'en', { + :foo => { :link => :linked }, + :linked => 'linked' + } + assert_equal('linked', I18n.backend.translate('en', :'foo.link')) + end + + test "linked lookup: if a dot-separated key resolves to a dot-separated symbol it looks up the symbol" do + I18n.backend.store_translations 'en', { + :foo => { :link => :"bar.linked" }, + :bar => { :linked => 'linked' } + } + assert_equal('linked', I18n.backend.translate('en', :'foo.link')) + end + + test "linked lookup: links always refer to the absolute key" do + I18n.backend.store_translations 'en', { + :foo => { :link => :linked, :linked => 'linked in foo' }, + :linked => 'linked absolutely' + } + assert_equal 'linked absolutely', I18n.backend.translate('en', :link, :scope => :foo) + end + + test "linked lookup: a link can resolve to a namespace in the middle of a dot-separated key" do + I18n.backend.store_translations 'en', { + :activemodel => { :errors => { :messages => { :blank => "can't be blank" } } }, + :activerecord => { :errors => { :messages => :"activemodel.errors.messages" } } + } + assert_equal "can't be blank", I18n.t(:"activerecord.errors.messages.blank") + assert_equal "can't be blank", I18n.t(:"activerecord.errors.messages.blank") + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/localization.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/localization.rb new file mode 100644 index 0000000000..53b15029da --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/localization.rb @@ -0,0 +1,19 @@ +module I18n + module Tests + module Localization + autoload :Date, 'i18n/tests/localization/date' + autoload :DateTime, 'i18n/tests/localization/date_time' + autoload :Time, 'i18n/tests/localization/time' + autoload :Procs, 'i18n/tests/localization/procs' + + def self.included(base) + base.class_eval do + include I18n::Tests::Localization::Date + include I18n::Tests::Localization::DateTime + include I18n::Tests::Localization::Procs + include I18n::Tests::Localization::Time + end + end + end + end +end \ No newline at end of file diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/localization/date.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/localization/date.rb new file mode 100644 index 0000000000..fba5fe5c0b --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/localization/date.rb @@ -0,0 +1,95 @@ +# encoding: utf-8 + +module I18n + module Tests + module Localization + module Date + def setup + super + setup_date_translations + @date = ::Date.new(2008, 3, 1) + end + + test "localize Date: given the short format it uses it" do + # TODO should be Mrz, shouldn't it? + assert_equal '01. Mar', I18n.l(@date, :format => :short, :locale => :de) + end + + test "localize Date: given the long format it uses it" do + assert_equal '01. März 2008', I18n.l(@date, :format => :long, :locale => :de) + end + + test "localize Date: given the default format it uses it" do + assert_equal '01.03.2008', I18n.l(@date, :format => :default, :locale => :de) + end + + test "localize Date: given a day name format it returns the correct day name" do + assert_equal 'Samstag', I18n.l(@date, :format => '%A', :locale => :de) + end + + test "localize Date: given an abbreviated day name format it returns the correct abbreviated day name" do + assert_equal 'Sa', I18n.l(@date, :format => '%a', :locale => :de) + end + + test "localize Date: given a month name format it returns the correct month name" do + assert_equal 'März', I18n.l(@date, :format => '%B', :locale => :de) + end + + test "localize Date: given an abbreviated month name format it returns the correct abbreviated month name" do + # TODO should be Mrz, shouldn't it? + assert_equal 'Mar', I18n.l(@date, :format => '%b', :locale => :de) + end + + test "localize Date: given an unknown format it does not fail" do + assert_nothing_raised { I18n.l(@date, :format => '%x') } + end + + test "localize Date: does not modify the options hash" do + options = { :format => '%b', :locale => :de } + assert_equal 'Mar', I18n.l(@date, options) + assert_equal({ :format => '%b', :locale => :de }, options) + assert_nothing_raised { I18n.l(@date, options.freeze) } + end + + test "localize Date: given nil with default value it returns default" do + assert_equal 'default', I18n.l(nil, :default => 'default') + end + + test "localize Date: given nil it raises I18n::ArgumentError" do + assert_raise(I18n::ArgumentError) { I18n.l(nil) } + end + + test "localize Date: given a plain Object it raises I18n::ArgumentError" do + assert_raise(I18n::ArgumentError) { I18n.l(Object.new) } + end + + test "localize Date: given a format is missing it raises I18n::MissingTranslationData" do + assert_raise(I18n::MissingTranslationData) { I18n.l(@date, :format => :missing) } + end + + test "localize Date: it does not alter the format string" do + assert_equal '01. Februar 2009', I18n.l(::Date.parse('2009-02-01'), :format => :long, :locale => :de) + assert_equal '01. Oktober 2009', I18n.l(::Date.parse('2009-10-01'), :format => :long, :locale => :de) + end + + protected + + def setup_date_translations + I18n.backend.store_translations :de, { + :date => { + :formats => { + :default => "%d.%m.%Y", + :short => "%d. %b", + :long => "%d. %B %Y", + }, + :day_names => %w(Sonntag Montag Dienstag Mittwoch Donnerstag Freitag Samstag), + :abbr_day_names => %w(So Mo Di Mi Do Fr Sa), + :month_names => %w(Januar Februar März April Mai Juni Juli August September Oktober November Dezember).unshift(nil), + :abbr_month_names => %w(Jan Feb Mar Apr Mai Jun Jul Aug Sep Okt Nov Dez).unshift(nil) + } + } + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/localization/date_time.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/localization/date_time.rb new file mode 100644 index 0000000000..7a30bff491 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/localization/date_time.rb @@ -0,0 +1,82 @@ +# encoding: utf-8 + +module I18n + module Tests + module Localization + module DateTime + def setup + super + setup_datetime_translations + @datetime = ::DateTime.new(2008, 3, 1, 6) + @other_datetime = ::DateTime.new(2008, 3, 1, 18) + end + + test "localize DateTime: given the short format it uses it" do + # TODO should be Mrz, shouldn't it? + assert_equal '01. Mar 06:00', I18n.l(@datetime, :format => :short, :locale => :de) + end + + test "localize DateTime: given the long format it uses it" do + assert_equal '01. März 2008 06:00', I18n.l(@datetime, :format => :long, :locale => :de) + end + + test "localize DateTime: given the default format it uses it" do + # TODO should be Mrz, shouldn't it? + assert_equal 'Sa, 01. Mar 2008 06:00:00 +0000', I18n.l(@datetime, :format => :default, :locale => :de) + end + + test "localize DateTime: given a day name format it returns the correct day name" do + assert_equal 'Samstag', I18n.l(@datetime, :format => '%A', :locale => :de) + end + + test "localize DateTime: given an abbreviated day name format it returns the correct abbreviated day name" do + assert_equal 'Sa', I18n.l(@datetime, :format => '%a', :locale => :de) + end + + test "localize DateTime: given a month name format it returns the correct month name" do + assert_equal 'März', I18n.l(@datetime, :format => '%B', :locale => :de) + end + + test "localize DateTime: given an abbreviated month name format it returns the correct abbreviated month name" do + # TODO should be Mrz, shouldn't it? + assert_equal 'Mar', I18n.l(@datetime, :format => '%b', :locale => :de) + end + + test "localize DateTime: given a meridian indicator format it returns the correct meridian indicator" do + assert_equal 'AM', I18n.l(@datetime, :format => '%p', :locale => :de) + assert_equal 'PM', I18n.l(@other_datetime, :format => '%p', :locale => :de) + end + + test "localize DateTime: given a meridian indicator format it returns the correct meridian indicator in downcase" do + assert_equal 'am', I18n.l(@datetime, :format => '%P', :locale => :de) + assert_equal 'pm', I18n.l(@other_datetime, :format => '%P', :locale => :de) + end + + test "localize DateTime: given an unknown format it does not fail" do + assert_nothing_raised { I18n.l(@datetime, :format => '%x') } + end + + test "localize DateTime: given a format is missing it raises I18n::MissingTranslationData" do + assert_raise(I18n::MissingTranslationData) { I18n.l(@datetime, :format => :missing) } + end + + protected + + def setup_datetime_translations + # time translations might have been set up in Tests::Api::Localization::Time + I18n.backend.store_translations :de, { + :time => { + :formats => { + :default => "%a, %d. %b %Y %H:%M:%S %z", + :short => "%d. %b %H:%M", + :long => "%d. %B %Y %H:%M" + }, + :am => 'am', + :pm => 'pm' + } + } + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/localization/procs.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/localization/procs.rb new file mode 100644 index 0000000000..de62488862 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/localization/procs.rb @@ -0,0 +1,116 @@ +# encoding: utf-8 + +module I18n + module Tests + module Localization + module Procs + test "localize: using day names from lambdas" do + setup_time_proc_translations + time = ::Time.utc(2008, 3, 1, 6, 0) + assert_match(/Суббота/, I18n.l(time, :format => "%A, %d %B", :locale => :ru)) + assert_match(/суббота/, I18n.l(time, :format => "%d %B (%A)", :locale => :ru)) + end + + test "localize: using month names from lambdas" do + setup_time_proc_translations + time = ::Time.utc(2008, 3, 1, 6, 0) + assert_match(/марта/, I18n.l(time, :format => "%d %B %Y", :locale => :ru)) + assert_match(/Март /, I18n.l(time, :format => "%B %Y", :locale => :ru)) + end + + test "localize: using abbreviated day names from lambdas" do + setup_time_proc_translations + time = ::Time.utc(2008, 3, 1, 6, 0) + assert_match(/марта/, I18n.l(time, :format => "%d %b %Y", :locale => :ru)) + assert_match(/март /, I18n.l(time, :format => "%b %Y", :locale => :ru)) + end + + test "localize Date: given a format that resolves to a Proc it calls the Proc with the object" do + setup_time_proc_translations + date = ::Date.new(2008, 3, 1) + assert_equal '[Sat, 01 Mar 2008, {}]', I18n.l(date, :format => :proc, :locale => :ru) + end + + test "localize Date: given a format that resolves to a Proc it calls the Proc with the object and extra options" do + setup_time_proc_translations + date = ::Date.new(2008, 3, 1) + assert_equal '[Sat, 01 Mar 2008, {:foo=>"foo"}]', I18n.l(date, :format => :proc, :foo => 'foo', :locale => :ru) + end + + test "localize DateTime: given a format that resolves to a Proc it calls the Proc with the object" do + setup_time_proc_translations + datetime = ::DateTime.new(2008, 3, 1, 6) + assert_equal '[Sat, 01 Mar 2008 06:00:00 +00:00, {}]', I18n.l(datetime, :format => :proc, :locale => :ru) + end + + test "localize DateTime: given a format that resolves to a Proc it calls the Proc with the object and extra options" do + setup_time_proc_translations + datetime = ::DateTime.new(2008, 3, 1, 6) + assert_equal '[Sat, 01 Mar 2008 06:00:00 +00:00, {:foo=>"foo"}]', I18n.l(datetime, :format => :proc, :foo => 'foo', :locale => :ru) + end + + test "localize Time: given a format that resolves to a Proc it calls the Proc with the object" do + setup_time_proc_translations + time = ::Time.utc(2008, 3, 1, 6, 0) + assert_equal I18n::Tests::Localization::Procs.inspect_args([time, {}]), I18n.l(time, :format => :proc, :locale => :ru) + end + + test "localize Time: given a format that resolves to a Proc it calls the Proc with the object and extra options" do + setup_time_proc_translations + time = ::Time.utc(2008, 3, 1, 6, 0) + options = { :foo => 'foo' } + assert_equal I18n::Tests::Localization::Procs.inspect_args([time, options]), I18n.l(time, options.merge(:format => :proc, :locale => :ru)) + end + + protected + + def self.inspect_args(args) + args = args.map do |arg| + case arg + when ::Time, ::DateTime + arg.strftime('%a, %d %b %Y %H:%M:%S %Z').sub('+0000', '+00:00') + when ::Date + arg.strftime('%a, %d %b %Y') + when Hash + arg.delete(:fallback_in_progress) + arg.inspect + else + arg.inspect + end + end + "[#{args.join(', ')}]" + end + + def setup_time_proc_translations + I18n.backend.store_translations :ru, { + :time => { + :formats => { + :proc => lambda { |*args| I18n::Tests::Localization::Procs.inspect_args(args) } + } + }, + :date => { + :formats => { + :proc => lambda { |*args| I18n::Tests::Localization::Procs.inspect_args(args) } + }, + :'day_names' => lambda { |key, options| + (options[:format] =~ /^%A/) ? + %w(Воскресенье Понедельник Вторник Среда Четверг Пятница Суббота) : + %w(воскресенье понедельник вторник среда четверг пятница суббота) + }, + :'month_names' => lambda { |key, options| + (options[:format] =~ /(%d|%e)(\s*)?(%B)/) ? + %w(января февраля марта апреля мая июня июля августа сентября октября ноября декабря).unshift(nil) : + %w(Январь Февраль Март Апрель Май Июнь Июль Август Сентябрь Октябрь Ноябрь Декабрь).unshift(nil) + }, + :'abbr_month_names' => lambda { |key, options| + (options[:format] =~ /(%d|%e)(\s*)(%b)/) ? + %w(янв. февр. марта апр. мая июня июля авг. сент. окт. нояб. дек.).unshift(nil) : + %w(янв. февр. март апр. май июнь июль авг. сент. окт. нояб. дек.).unshift(nil) + }, + } + } + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/localization/time.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/localization/time.rb new file mode 100644 index 0000000000..8bbba43c18 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/localization/time.rb @@ -0,0 +1,81 @@ +# encoding: utf-8 + +module I18n + module Tests + module Localization + module Time + def setup + super + setup_time_translations + @time = ::Time.utc(2008, 3, 1, 6, 0) + @other_time = ::Time.utc(2008, 3, 1, 18, 0) + end + + test "localize Time: given the short format it uses it" do + # TODO should be Mrz, shouldn't it? + assert_equal '01. Mar 06:00', I18n.l(@time, :format => :short, :locale => :de) + end + + test "localize Time: given the long format it uses it" do + assert_equal '01. März 2008 06:00', I18n.l(@time, :format => :long, :locale => :de) + end + + # TODO Seems to break on Windows because ENV['TZ'] is ignored. What's a better way to do this? + # def test_localize_given_the_default_format_it_uses_it + # assert_equal 'Sa, 01. Mar 2008 06:00:00 +0000', I18n.l(@time, :format => :default, :locale => :de) + # end + + test "localize Time: given a day name format it returns the correct day name" do + assert_equal 'Samstag', I18n.l(@time, :format => '%A', :locale => :de) + end + + test "localize Time: given an abbreviated day name format it returns the correct abbreviated day name" do + assert_equal 'Sa', I18n.l(@time, :format => '%a', :locale => :de) + end + + test "localize Time: given a month name format it returns the correct month name" do + assert_equal 'März', I18n.l(@time, :format => '%B', :locale => :de) + end + + test "localize Time: given an abbreviated month name format it returns the correct abbreviated month name" do + # TODO should be Mrz, shouldn't it? + assert_equal 'Mar', I18n.l(@time, :format => '%b', :locale => :de) + end + + test "localize Time: given a meridian indicator format it returns the correct meridian indicator" do + assert_equal 'AM', I18n.l(@time, :format => '%p', :locale => :de) + assert_equal 'PM', I18n.l(@other_time, :format => '%p', :locale => :de) + end + + test "localize Time: given a meridian indicator format it returns the correct meridian indicator in upcase" do + assert_equal 'am', I18n.l(@time, :format => '%P', :locale => :de) + assert_equal 'pm', I18n.l(@other_time, :format => '%P', :locale => :de) + end + + test "localize Time: given an unknown format it does not fail" do + assert_nothing_raised { I18n.l(@time, :format => '%x') } + end + + test "localize Time: given a format is missing it raises I18n::MissingTranslationData" do + assert_raise(I18n::MissingTranslationData) { I18n.l(@time, :format => :missing) } + end + + protected + + def setup_time_translations + I18n.backend.store_translations :de, { + :time => { + :formats => { + :default => "%a, %d. %b %Y %H:%M:%S %z", + :short => "%d. %b %H:%M", + :long => "%d. %B %Y %H:%M", + }, + :am => 'am', + :pm => 'pm' + } + } + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/lookup.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/lookup.rb new file mode 100644 index 0000000000..3b4c843494 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/lookup.rb @@ -0,0 +1,81 @@ +# encoding: utf-8 + +module I18n + module Tests + module Lookup + def setup + super + I18n.backend.store_translations(:en, :foo => { :bar => 'bar', :baz => 'baz' }, :falsy => false, :truthy => true, + :string => "a", :array => %w(a b c), :hash => { "a" => "b" }) + end + + test "lookup: it returns a string" do + assert_equal("a", I18n.t(:string)) + end + + test "lookup: it returns hash" do + assert_equal({ :a => "b" }, I18n.t(:hash)) + end + + test "lookup: it returns an array" do + assert_equal(%w(a b c), I18n.t(:array)) + end + + test "lookup: it returns a native true" do + assert I18n.t(:truthy) === true + end + + test "lookup: it returns a native false" do + assert I18n.t(:falsy) === false + end + + test "lookup: given a missing key, no default and no raise option it returns an error message" do + assert_equal "translation missing: en.missing", I18n.t(:missing) + end + + test "lookup: given a missing key, no default and the raise option it raises MissingTranslationData" do + assert_raise(I18n::MissingTranslationData) { I18n.t(:missing, :raise => true) } + end + + test "lookup: does not raise an exception if no translation data is present for the given locale" do + assert_nothing_raised { I18n.t(:foo, :locale => :xx) } + end + + test "lookup: does not modify the options hash" do + options = {} + assert_equal "a", I18n.t(:string, options) + assert_equal({}, options) + assert_nothing_raised { I18n.t(:string, options.freeze) } + end + + test "lookup: given an array of keys it translates all of them" do + assert_equal %w(bar baz), I18n.t([:bar, :baz], :scope => [:foo]) + end + + test "lookup: using a custom scope separator" do + # data must have been stored using the custom separator when using the ActiveRecord backend + I18n.backend.store_translations(:en, { :foo => { :bar => 'bar' } }, { :separator => '|' }) + assert_equal 'bar', I18n.t('foo|bar', :separator => '|') + end + + # In fact it probably *should* fail but Rails currently relies on using the default locale instead. + # So we'll stick to this for now until we get it fixed in Rails. + test "lookup: given nil as a locale it does not raise but use the default locale" do + # assert_raise(I18n::InvalidLocale) { I18n.t(:bar, :locale => nil) } + assert_nothing_raised { I18n.t(:bar, :locale => nil) } + end + + test "lookup: a resulting String is not frozen" do + assert !I18n.t(:string).frozen? + end + + test "lookup: a resulting Array is not frozen" do + assert !I18n.t(:array).frozen? + end + + test "lookup: a resulting Hash is not frozen" do + assert !I18n.t(:hash).frozen? + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/pluralization.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/pluralization.rb new file mode 100644 index 0000000000..d3319dcdad --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/pluralization.rb @@ -0,0 +1,35 @@ +# encoding: utf-8 + +module I18n + module Tests + module Pluralization + test "pluralization: given 0 it returns the :zero translation if it is defined" do + assert_equal 'zero', I18n.t(:default => { :zero => 'zero' }, :count => 0) + end + + test "pluralization: given 0 it returns the :other translation if :zero is not defined" do + assert_equal 'bars', I18n.t(:default => { :other => 'bars' }, :count => 0) + end + + test "pluralization: given 1 it returns the singular translation" do + assert_equal 'bar', I18n.t(:default => { :one => 'bar' }, :count => 1) + end + + test "pluralization: given 2 it returns the :other translation" do + assert_equal 'bars', I18n.t(:default => { :other => 'bars' }, :count => 2) + end + + test "pluralization: given 3 it returns the :other translation" do + assert_equal 'bars', I18n.t(:default => { :other => 'bars' }, :count => 3) + end + + test "pluralization: given nil it returns the whole entry" do + assert_equal({ :one => 'bar' }, I18n.t(:default => { :one => 'bar' }, :count => nil)) + end + + test "pluralization: given incomplete pluralization data it raises I18n::InvalidPluralizationData" do + assert_raise(I18n::InvalidPluralizationData) { I18n.t(:default => { :one => 'bar' }, :count => 2) } + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/procs.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/procs.rb new file mode 100644 index 0000000000..aa2df19afb --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/tests/procs.rb @@ -0,0 +1,55 @@ +# encoding: utf-8 + +module I18n + module Tests + module Procs + test "lookup: given a translation is a proc it calls the proc with the key and interpolation values" do + I18n.backend.store_translations(:en, :a_lambda => lambda { |*args| I18n::Tests::Procs.filter_args(*args) }) + assert_equal '[:a_lambda, {:foo=>"foo"}]', I18n.t(:a_lambda, :foo => 'foo') + end + + test "defaults: given a default is a Proc it calls it with the key and interpolation values" do + proc = lambda { |*args| I18n::Tests::Procs.filter_args(*args) } + assert_equal '[nil, {:foo=>"foo"}]', I18n.t(nil, :default => proc, :foo => 'foo') + end + + test "defaults: given a default is a key that resolves to a Proc it calls it with the key and interpolation values" do + the_lambda = lambda { |*args| I18n::Tests::Procs.filter_args(*args) } + I18n.backend.store_translations(:en, :a_lambda => the_lambda) + assert_equal '[:a_lambda, {:foo=>"foo"}]', I18n.t(nil, :default => :a_lambda, :foo => 'foo') + assert_equal '[:a_lambda, {:foo=>"foo"}]', I18n.t(nil, :default => [nil, :a_lambda], :foo => 'foo') + end + + test "interpolation: given an interpolation value is a lambda it calls it with key and values before interpolating it" do + proc = lambda { |*args| I18n::Tests::Procs.filter_args(*args) } + assert_match %r(\[\{:foo=>#\}\]), I18n.t(nil, :default => '%{foo}', :foo => proc) + end + + test "interpolation: given a key resolves to a Proc that returns a string then interpolation still works" do + proc = lambda { |*args| "%{foo}: " + I18n::Tests::Procs.filter_args(*args) } + assert_equal 'foo: [nil, {:foo=>"foo"}]', I18n.t(nil, :default => proc, :foo => 'foo') + end + + test "pluralization: given a key resolves to a Proc that returns valid data then pluralization still works" do + proc = lambda { |*args| { :zero => 'zero', :one => 'one', :other => 'other' } } + assert_equal 'zero', I18n.t(:default => proc, :count => 0) + assert_equal 'one', I18n.t(:default => proc, :count => 1) + assert_equal 'other', I18n.t(:default => proc, :count => 2) + end + + test "lookup: given the option :resolve => false was passed it does not resolve proc translations" do + I18n.backend.store_translations(:en, :a_lambda => lambda { |*args| I18n::Tests::Procs.filter_args(*args) }) + assert_equal Proc, I18n.t(:a_lambda, :resolve => false).class + end + + test "lookup: given the option :resolve => false was passed it does not resolve proc default" do + assert_equal Proc, I18n.t(nil, :default => lambda { |*args| I18n::Tests::Procs.filter_args(*args) }, :resolve => false).class + end + + + def self.filter_args(*args) + args.map {|arg| arg.delete(:fallback_in_progress) if arg.is_a?(Hash) ; arg }.inspect + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/version.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/version.rb similarity index 70% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/version.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/version.rb index 6491d1809b..c1cf960a75 100644 --- a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.0/lib/i18n/version.rb +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/i18n-1.1.1/lib/i18n/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module I18n - VERSION = "1.1.0" + VERSION = "1.1.1" end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/CHANGELOG.md b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/CHANGELOG.md new file mode 100644 index 0000000000..3a351c492e --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/CHANGELOG.md @@ -0,0 +1,391 @@ +# Change log + +## Master (Unreleased) + +## 1.30.1 (2018-11-01) + +* `FactoryBot/CreateList` now ignores `times` blocks with an argument. ([@Darhazer][]) + +## 1.30.0 (2018-10-08) + +* Add config to `RSpec/VerifiedDoubles` to enforcement of verification on unnamed doubles. ([@BrentWheeldon][]) +* Fix `FactoryBot/AttributeDefinedStatically` not working when there is a non-symbol key. ([@vzvu3k6k][]) +* Fix false positive in `RSpec/ImplicitSubject` when `is_expected` is used inside `its()` block. ([@Darhazer][]) +* Add `single_statement_only` style to `RSpec/ImplicitSubject` as a more relaxed alternative to `single_line_only`. ([@Darhazer][]) +* Add `RSpec/UnspecifiedException` as a default cop to encourage more-specific `expect{}.to raise_error(ExceptionType)`, or `raise_exception` style handling of exceptions. ([@daveworth][]) + +## 1.29.1 (2018-09-01) + +* Fix false negative in `FactoryBot/AttributeDefinedStatically` when attribute is defined on `self`. ([@Darhazer][]) +* `RSpec/FactoryBot` cops will now also inspect the `spec/factories.rb` path by default. ([@bquorning][]) + +## 1.29.0 (2018-08-25) + +* `RSpec/InstanceVariable` - Recommend local variables in addition to `let`. ([@jaredbeck][]) +* Add `RSpec/ImplicitSubject` cop. ([@Darhazer][]) +* Add `RSpec/HooksBeforeExamples` cop. ([@Darhazer][]) + +## 1.28.0 (2018-08-14) + +* Add `RSpec/ReceiveNever` cop enforcing usage of `not_to receive` instead of `never` matcher. ([@Darhazer][]) +* Fix false positive in `RSpec/EmptyLineAfterExampleGroup` cop when example is inside `if`. ([@Darhazer][]) +* Add `RSpec/MissingExampleGroupArgument` to enforce first argument for an example group. ([@geniou][]) +* Drop support for ruby `2.1`. ([@bquorning][]) +* Add `FactoryBot/AttributeDefinedStatically` cop to help FactoryBot users with the deprecation of static attributes. ([@composerinteralia][], [@seanpdoyle][]) +* Remove `FactoryBot/DynamicAttributeDefinedStatically` and `FactoryBot/StaticAttributeDefinedDynamically` cops. ([@composerinteralia][]) + +## 1.27.0 (2018-06-14) + +* `RSpec/LeadingSubject` now enforces subject to be before any examples, hooks or let declarations. ([@Darhazer][]) +* Fix `RSpec/NotToNot` to highlight only the selector (`not_to` or `to_not`), so it works also on `expect { ... }` blocks. ([@bquorning][]) +* Add `RSpec/EmptyLineAfterHook` cop. ([@bquorning][]) +* Add `RSpec/EmptyLineAfterExampleGroup` cop to check that there is an empty line after example group blocks. ([@bquorning][]) +* Fix `RSpec/DescribeClass` crashing on `RSpec.describe` without arguments. ([@Darhazer][]) +* Bump RuboCop requirement to v0.56.0. ([@bquorning][]) +* Fix `RSpec/OverwritingSetup` crashing if a variable is used as an argument for `let`. ([@Darhazer][]) + +## 1.26.0 (2018-06-06) + +* Fix false positive in `RSpec/EmptyExampleGroup` cop when methods named like a RSpec method are used. ([@Darhazer][]) +* Fix `Capybara/FeatureMethods` not working when there is require before the spec. ([@Darhazer][]) +* Fix `RSpec/EmptyLineAfterFinalLet`: allow a comment to be placed after latest let, requiring empty line after the comment. ([@Darhazer][]) +* Add `RSpec/ReceiveCounts` cop to enforce usage of :once and :twice matchers. ([@Darhazer][]) + +## 1.25.1 (2018-04-10) + +* Fix false positive in `RSpec/Pending` cop when pending is used as a method name. ([@Darhazer][]) +* Fix `FactoryBot/DynamicAttributeDefinedStatically` false positive when using symbol proc argument for a sequence. ([@tdeo][]) + +## 1.25.0 (2018-04-07) + +* Add `RSpec/SharedExamples` cop to enforce consistent usage of string to titleize shared examples. ([@anthony-robin][]) +* Add `RSpec/Be` cop to enforce passing argument to the generic `be` matcher. ([@Darhazer][]) +* Fix false positives in `StaticAttributeDefinedDynamically` and `ReturnFromStub` when a const is used in an array or hash. ([@Darhazer][]) +* Add `RSpec/Pending` cop to enforce no existing pending or skipped examples. This is disabled by default. ([@patrickomatic][]) +* Fix `RSpec/NestedGroups` cop support --auto-gen-config. ([@walf443][]) +* Fix false positives in `Capybara/FeatureMethods` when feature methods are used as property names in a factory. ([@Darhazer][]) +* Allow configuring enabled methods in `Capybara/FeatureMethods`. ([@Darhazer][]) +* Add `FactoryBot/CreateList` cop. ([@Darhazer][]) + +## 1.24.0 (2018-03-06) + +* Compatibility with RuboCop v0.53.0. ([@bquorning][]) +* The `Rails/HttpStatus` cop is unavailable if the `rack` gem cannot be loaded. ([@bquorning][]) +* Fix `Rails/HttpStatus` not working with custom HTTP status codes. ([@bquorning][]) +* Fix `FactoryBot/StaticAttributeDefinedDynamically` to handle empty block. ([@abrom][]) +* Fix false positive in `FactoryBot/DynamicAttributeDefinedStatically` when a before/after callback has a symbol proc argument. ([@abrom][]) + +## 1.23.0 (2018-02-23) + +* Add `RSpec/Rails/HttpStatus` cop to enforce consistent usage of the status format (numeric or symbolic). ([@anthony-robin][], [@jojos003][]) +* Fix false negative in `RSpec/ReturnFromStub` when a constant is being returned by the stub. ([@Darhazer][]) +* Fix `FactoryBot/DynamicAttributeDefinedStatically` to handle dynamic attributes inside arrays/hashes. ([@abrom][]) +* Add `FactoryBot/StaticAttributeDefinedDynamically` (based on dynamic attribute cop). ([@abrom][]) + +## 1.22.2 (2018-02-01) + +* Fix error in `RSpec/DescribedClass` when working on an empty `describe` block. ([@bquorning][]) + +## 1.22.1 (2018-01-17) + +* Fix false positives in `RSpec/ReturnFromStub`. ([@Darhazer][]) + +## 1.22.0 (2018-01-10) + +* Updates `describe_class` to account for RSpecs `:system` wrapper of rails system tests. ([@EliseFitz15][]) +* Add `RSpec/ExpectChange` cop to enforce consistent usage of the change matcher. ([@Darhazer][]) +* Add autocorrect support to `RSpec/LetBeforeExamples`. ([@Darhazer][]) +* Fix `RSpec/InstanceVariable` flagging instance variables inside dynamically defined class. ([@Darhazer][]) +* Add autocorrect support for `RSpec/ReturnFromStub` cop. ([@bquorning][]) +* Add `RSpec/ExampleWithoutDescription` cop. ([@Darhazer][]) + +## 1.21.0 (2017-12-13) + +* Compatibility with RuboCop v0.52.0. ([@bquorning][]) +* Improve performance when user does not override default RSpec Pattern config. ([@walf443][]) +* Add `AggregateFailuresByDefault` configuration for `RSpec/MultipleExpectations` cop. ([@onk][]) + +## 1.20.1 (2017-11-15) + +* Add "without" to list of default allowed prefixes for `RSpec/ContextWording`. ([@bquorning][]) + +## 1.20.0 (2017-11-09) + +* Rename namespace `FactoryGirl` to `FactoryBot` following original library update. ([@walf443][]) +* Fix exception in `RSpec/ReturnFromStub` on empty block. ([@yevhene][]) +* Add `RSpec/ContextWording` cop. ([@pirj][], [@telmofcosta][]) +* Fix `RSpec/SubjectStub` cop matches receive message inside all matcher. ([@walf443][]) + +## 1.19.0 (2017-10-18) + +Compatibility release so users can upgrade RuboCop to 0.51.0. No new features. + +## 1.18.0 (2017-09-29) + +* Fix false positive in `Capybara/FeatureMethods`. ([@Darhazer][]) +* Add `RSpec/Capybara/CurrentPathExpectation` cop for feature specs, disallowing setting expectations on `current_path`. ([@timrogers][]) +* Fix false positive in `RSpec/LetBeforeExamples` cop when example group contains single let. ([@Darhazer][]) + +## 1.17.1 (2017-09-20) + +* Improved `RSpec/ReturnFromStub` to handle string interpolation, hashes and do..end blocks. ([@Darhazer][]) +* Fixed compatibility with JRuby. ([@zverok][]) + +## 1.17.0 (2017-09-14) + +* Add `RSpec/Capybara` namespace including the first cop for feature specs: `Capybara/FeatureMethods`. ([@rspeicher][]) +* Update to RuboCop 0.50.0. ([@bquorning][]) + +## 1.16.0 (2017-09-06) + +* Add `RSpec/FactoryGirl` namespace including the first cop for factories: `FactoryGirl/DynamicAttributeDefinedStatically`. ([@jonatas][]) +* Add disabled by default `RSpec/AlignLeftLetBrace`. ([@backus][]) +* Add disabled by default `RSpec/AlignRightLetBrace`. ([@backus][]) +* Add `RSpec/LetBeforeExamples` cop. ([@Darhazer][]) +* Add `RSpec/MultipleSubjects` cop. ([@backus][]) +* Add `RSpec/ReturnFromStub` cop. ([@Darhazer][]) +* Add `RSpec/VoidExpect` cop. ([@pocke][]) +* Add `RSpec/InvalidPredicateMatcher` cop. ([@pocke][]) +* Change HookArgument cop to detect when hook has a receiver. ([@pocke][]) +* Add `RSpec/PredicateMatcher` cop. ([@pocke][]) +* Add `RSpec/ExpectInHook` cop. ([@pocke][]) +* `RSpec/MultipleExpectations` now detects usage of expect_any_instance_of. ([@Darhazer][]) +* `RSpec/MultipleExpectations` now detects usage of is_expected. ([@bmorrall][]) + +## 1.15.1 (2017-04-30) + +* Fix the handling of various edge cases in the `RSpec/ExampleWording` cop, including one that would cause autocorrect to crash. ([@dgollahon][]) +* Fix `RSpec/IteratedExpectation` crashing when there is an assignment in the iteration. ([@Darhazer][]) +* Fix false positive in `RSpec/SingleArgumentMessageChain` cop when the single argument is a hash. ([@Darhazer][]) + +## 1.15.0 (2017-03-24) + +* Add `RSpec/DescribeSymbol` cop. ([@rspeicher][]) +* Fix error when `RSpec/OverwritingSetup` and `RSpec/ScatteredLet` analyzed empty example groups. ([@backus][]) + +## 1.14.0 (2017-03-24) + +* Add `RSpec/OverwritingSetup` cop. ([@Darhazer][]) +* Add autocorrect support for `RSpec/LeadingSubject` cop. ([@Darhazer][]) +* Add `RSpec/ScatteredLet` cop. ([@Darhazer][]) +* Add `RSpec/IteratedExpectation` cop. ([@Darhazer][]) +* Add `RSpec/EmptyLineAfterSubject` cop. ([@Darhazer][]) +* Add `RSpec/EmptyLineAfterFinalLet` cop. ([@Darhazer][]) + +## 1.13.0 (2017-03-07) + +* Add repeated 'it' detection to `RSpec/ExampleWording` cop. ([@dgollahon][]) +* Add [observed_nesting/max_nesting] info to `RSpec/NestedGroups` messages. ([@dgollahon][]) +* Add `RSpec/ItBehavesLike` cop. ([@dgollahon][]) +* Add `RSpec/SharedContext` cop. ([@Darhazer][]) +* `Rspec/MultipleExpectations`: Count aggregate_failures block as single expectation. ([@Darhazer][]) +* Fix `ExpectActual` cop flagging `rspec-rails` routing specs. ([@backus][]) +* Fix `FilePath` cop not registering offenses for files like `spec/blog/user.rb` when it should be `spec/blog/user_spec.rb`. ([@backus][]) + +## 1.12.0 (2017-02-21) + +* Add `RSpec/InstanceSpy` cop. ([@Darhazer][]) +* Add `RSpec/BeforeAfterAll` for avoiding leaky global test setup. ([@cfabianski][]) + +## 1.11.0 (2017-02-16) + +* Add `AroundBlock` cop. ([@Darhazer][]) +* Add `EnforcedStyle` configuration for `RSpec/DescribedClass` cop. ([@Darhazer][]) +* Fix false positive for `RSpec/RepeatedExample` cop. ([@redross][]) + +## 1.10.0 (2017-01-15) + +* Fix false negative for `RSpec/MessageSpies` cop. ([@onk][]) +* Fix internal dependencies on RuboCop to be compatible with 0.47 release. ([@backus][]) +* Add autocorrect support for `SingleArgumentMessageChain` cop. ([@bquorning][]) +* Rename `NestedGroups`' configuration key from `MaxNesting` to `Max` in order to be consistent with other cop configuration. ([@backus][]) +* Add `RepeatedExample` cop for detecting repeated examples within example groups. ([@backus][]) +* Add `ScatteredSetup` cop for enforcing that only one `before`, `around`, and `after` hook are used per example group scope. ([@backus][]) +* Add `ExpectOutput` cop for recommending `expect { ... }.to output(...).to_stdout`. ([@backus][]) + +## 1.9.1 (2017-01-02) + +* Fix unintentional regression change in `NestedGroups` reported in #270. ([@backus][]) +* Change `MaxNesting` for `NestedGroups` from 2 to 3. ([@backus][]) + +## 1.9.0 (2016-12-29) + +* Add `MessageSpies` cop for enforcing consistent style of either `expect(...).to have_received` or `expect(...).to receive`, intended as a replacement for the `MessageExpectation` cop. ([@bquorning][]) +* Fix `DescribeClass` to not flag `describe` at the top of a block of shared examples. ([@clupprich][]) +* Add `SingleArgumentMessageChain` cop for recommending use of `receive` instead of `receive_message_chain` where possible. ([@bquorning][]) +* Add `RepeatedDescription` cop for detecting repeated example descriptions within example groups. ([@backus][]) + +## 1.8.0 (2016-10-27) + +* Optionally ignore method names in the `describe` argument when running the `FilePath` cop. ([@bquorning][]) +* Fix regression in how `FilePath` converts alphanumeric class names into paths. ([@bquorning][]) +* Add `ImplicitExpect` cop for enforcing `should` vs. `is_expected.to`. ([@backus][]) +* Disable `MessageExpectation` cop in the default configuration. ([@bquorning][]) + +## 1.7.0 (2016-08-24) + +* Add support for checking all example groups with `ExampleLength`. ([@backus][]) +* Add support for checking shared example groups for `DescribedClass`. ([@backus][]) +* Add support for checking `its` from [rspec-its](https://github.com/rspec/rspec-its). ([@backus][]) +* Add `EmptyExampleGroup` cop for detecting `describe`s and `context`s without any tests inside. ([@backus][]) +* Add `CustomIncludeMethods` configuration option for `EmptyExampleGroup`. ([@backus][]) +* Add `NestedGroups` cop for detecting excessive example group nesting. ([@backus][]) +* Add `MaxNesting` configuration option for `NestedGroups` cop. ([@backus][]) +* Add `ExpectActual` cop for detecting literal values within `expect(...)`. ([@backus][]) +* Add `MultipleExpectations` cop for detecting multiple `expect(...)` calls within one example. ([@backus][]) +* Add `Max` configuration option for `MultipleExpectations`. ([@backus][]) +* Add `SubjectStub` cop for testing stubbed test subjects. ([@backus][]) +* Add `LetSetup` cop for detecting cases where `let!` is used for test setup. ([@backus][]) +* Change all cops to only inspect files with names following rspec convention (`*/spec/*` and/or `_spec.rb`). ([@backus][]) +* Add `AllCops/RSpec` configuration option for specifying custom spec file patterns. ([@backus][]) +* Add `AssignmentOnly` configuration option for `RSpec/InstanceVariable` cop. ([@backus][]) +* Add `BeEql` cop which looks for expectations that can use `be(...)` instead of `eql(...)`. ([@backus][]) +* Add autocorrect support for `BeEql` cop. ([@backus][]) +* Add `MessageExpectation` cop for enforcing consistent style of either `expect(...).to receive` or `allow(...).to receive`. ([@backus][]) +* Add `MessageChain` cop. ([@bquorning][]) + +## 1.6.0 (2016-08-03) + +* Add `SkipBlocks` option for `DescribedClass` cop. ([@backus][]) + +## 1.5.3 (2016-08-02) + +* Add `RSpec/NamedSubject` cop. ([@backus][]) + +## 1.5.2 (2016-08-01) + +* Drop support for ruby `2.0.0` and `2.1.0`. ([@backus][]) +* Internal refactorings and improved test coverage. ([@backus][]) + +## 1.5.1 (2016-07-20) + +* Fix `unrecognized parameter RSpec/VerifiedDoubles:IgnoreSymbolicNames` warning. ([@jeffreyc][]) +* Update to rubocop 0.41.2. ([@backus][]) + +## 1.5.0 (2016-05-17) + +* Expand `VerifiedDoubles` cop to check for `spy` as well as `double`. ([@andyw8][]) +* Enable `VerifiedDoubles` cop by default. ([@andyw8][]) +* Add `IgnoreSymbolicNames` option for `VerifiedDoubles` cop. ([@andyw8][]) +* Add `RSpec::ExampleLength` cop. ([@andyw8][]) +* Handle alphanumeric class names in `FilePath` cop. ([@andyw8][]) +* Skip `DescribeClass` cop for view specs. ([@andyw8][]) +* Skip `FilePath` cop for Rails routing specs. ([@andyw8][]) +* Add cop to check for focused specs. ([@renanborgescampos][], [@jaredmoody][]) +* Clean-up `RSpec::NotToNot` to use same configuration semantics as other Rubocop cops, add autocorrect support for `RSpec::NotToNot`. ([@baberthal][]) +* Update to rubocop 0.40.0. ([@nijikon][]) + +## 1.4.1 (2016-04-03) + +* Ignore routing specs for DescribeClass cop. ([@nijikon][]) +* Move rubocop dependency to runtime. ([@nijikon][]) +* Update to rubocop 0.39.0. ([@nijikon][]) + +## 1.4.0 (2016-02-15) + +* Update to rubocop 0.37.2. ([@nijikon][]) +* Update ruby versions we test against. ([@nijikon][]) +* Add `RSpec::NotToNot` cop. ([@miguelfteixeira][]) +* Add `Rspec/AnyInstance` cop. ([@mlarraz][]) + +## 1.3.1 + +* Fix auto correction issue - syntax had changed in RuboCop v0.31. ([@bquorning][]) +* Add RuboCop clone to vendor folder - see #39 for details. ([@bquorning][]) + +## 1.3.0 + +* Ignore non string arguments for FilePathCop - thanks to @deivid-rodriguez. ([@geniou][]) +* Skip DescribeMethod cop for tagged specs. ([@deivid-rodriguez][]) +* Skip DescribeClass cop for feature/request specs. ([@deivid-rodriguez][]) + +## 1.2.2 + +* Make `RSpec::ExampleWording` case insensitive. ([@geniou][]) + +## 1.2.1 + +* Add `RSpec::VerifiedDoubles` cop. ([@andyw8][]) + +## 1.2.0 + +* Drop support of ruby `1.9.2`. ([@geniou][]) +* Update to RuboCop `~> 0.24`. ([@geniou][]) +* Add `autocorrect` to `RSpec::ExampleWording`. This experimental - use with care and check the changes. ([@geniou][]) +* Fix config loader debug output. ([@geniou][]) +* Rename `FileName` cop to `FilePath` as a workaround - see [#19](https://github.com/nevir/rubocop-rspec/issues/19). ([@geniou][]) + +## 1.1.0 + +* Add `autocorrect` to `RSpec::DescribedClass` cop. ([@geniou][]) + +## 1.0.1 + +* Add `config` folder to gemspec. ([@pstengel][]) + +## 1.0.rc3 + +* Update to RuboCop `>= 0.23`. ([@geniou][]) +* Add configuration option for `CustomTransformation` to `FileName` cop. ([@geniou][]) + +## 1.0.rc2 + +* Gem is no longer 20MB (sorry!). ([@nevir][]) +* `RspecFileName` cop allows for method specs to organized into directories by class and type. ([@nevir][]) + +## 1.0.rc1 + +* Update code to work with rubocop `>= 0.19`. ([@geniou][]) +* Split `UnitSpecNaming` cop into `RSpecDescribeClass`, `RSpecDescribeMethod` and `RSpecFileName` and enabled them all by default. ([@geniou][]) +* Add `RSpecExampleWording` cop to prevent to use of should at the beginning of the spec description. ([@geniou][]) +* Fix `RSpecFileName` cop for non-class specs. ([@geniou][]) +* Adapt `RSpecFileName` cop to commen naming convention and skip spec with multiple top level describes. ([@geniou][]) +* Add `RSpecMultipleDescribes` cop to check for multiple top level describes. ([@geniou][]) +* Add `RSpecDescribedClass` to promote the use of `described_class`. ([@geniou][]) +* Add `RSpecInstanceVariable` cop to check for the usage of instance variables. ([@geniou][]) + + + +[@andyw8]: https://github.com/andyw8 +[@backus]: https://github.com/backus +[@bquorning]: https://github.com/bquorning +[@deivid-rodriguez]: https://github.com/deivid-rodriguez +[@geniou]: https://github.com/geniou +[@jaredbeck]: https://github.com/jaredbeck +[@jawshooah]: https://github.com/jawshooah +[@nevir]: https://github.com/nevir +[@nijikon]: https://github.com/nijikon +[@pstengel]: https://github.com/pstengel +[@miguelfteixeira]: https://github.com/miguelfteixeira +[@mlarraz]: https://github.com/mlarraz +[@renanborgescampos]: https://github.com/renanborgescampos +[@jaredmoody]: https://github.com/jaredmoody +[@baberthal]: https://github.com/baberthal +[@jeffreyc]: https://github.com/jeffreyc +[@clupprich]: https://github.com/clupprich +[@onk]: https://github.com/onk +[@Darhazer]: https://github.com/Darhazer +[@redross]: https://github.com/redross +[@cfabianski]: https://github.com/cfabianski +[@dgollahon]: https://github.com/dgollahon +[@rspeicher]: https://github.com/rspeicher +[@jonatas]: https://github.com/jonatas +[@pocke]: https://github.com/pocke +[@bmorrall]: https:/github.com/bmorrall +[@zverok]: https:/github.com/zverok +[@timrogers]: https://github.com/timrogers +[@yevhene]: https://github.com/yevhene +[@walf443]: https://github.com/walf443 +[@pirj]: https://github.com/pirj +[@telmofcosta]: https://github.com/telmofcosta +[@EliseFitz15]: https://github.com/EliseFitz15 +[@anthony-robin]: https://github.com/anthony-robin +[@jojos003]: https://github.com/jojos003 +[@abrom]: https://github.com/abrom +[@patrickomatic]: https://github.com/patrickomatic +[@tdeo]: https://github.com/tdeo +[@composerinteralia]: https://github.com/composerinteralia +[@seanpdoyle]: https://github.com/seanpdoyle +[@vzvu3k6k]: https://github.com/vzvu3k6k +[@BrentWheeldon]: https://github.com/BrentWheeldon +[@daveworth]: https://github.com/daveworth diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/Gemfile b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/Gemfile new file mode 100644 index 0000000000..7a1348f198 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/Gemfile @@ -0,0 +1,9 @@ +source 'https://rubygems.org' + +gemspec + +local_gemfile = 'Gemfile.local' + +if File.exist?(local_gemfile) + eval(File.read(local_gemfile)) # rubocop:disable Security/Eval +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/MIT-LICENSE.md b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/MIT-LICENSE.md new file mode 100644 index 0000000000..c628b7a916 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/MIT-LICENSE.md @@ -0,0 +1,22 @@ +The MIT License (MIT) +===================== + +Copyright (c) 2014 Ian MacLeod + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/README.md b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/README.md new file mode 100644 index 0000000000..b944acbcc4 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/README.md @@ -0,0 +1,146 @@ +# RuboCop RSpec + +[![Join the chat at https://gitter.im/rubocop-rspec/Lobby](https://badges.gitter.im/rubocop-rspec/Lobby.svg)](https://gitter.im/rubocop-rspec/Lobby) +[![Gem Version](https://badge.fury.io/rb/rubocop-rspec.svg)](https://rubygems.org/gems/rubocop-rspec) +[![CircleCI](https://circleci.com/gh/rubocop-hq/rubocop-rspec.svg?style=svg)](https://circleci.com/gh/rubocop-hq/rubocop-rspec) +[![Test Coverage](https://api.codeclimate.com/v1/badges/8ffaabf633c968c22bdd/test_coverage)](https://codeclimate.com/github/rubocop-hq/rubocop-rspec/test_coverage) +[![Maintainability](https://api.codeclimate.com/v1/badges/8ffaabf633c968c22bdd/maintainability)](https://codeclimate.com/github/rubocop-hq/rubocop-rspec/maintainability) + +RSpec-specific analysis for your projects, as an extension to +[RuboCop](https://github.com/rubocop-hq/rubocop). + +## Installation + +Just install the `rubocop-rspec` gem + +```bash +gem install rubocop-rspec +``` + +or if you use bundler put this in your `Gemfile` + +``` +gem 'rubocop-rspec' +``` + +## Usage + +You need to tell RuboCop to load the RSpec extension. There are three +ways to do this: + +### RuboCop configuration file + +Put this into your `.rubocop.yml`. + +``` +require: rubocop-rspec +``` + +Now you can run `rubocop` and it will automatically load the RuboCop RSpec +cops together with the standard cops. + +### Command line + +```bash +rubocop --require rubocop-rspec +``` + +### Rake task + +```ruby +RuboCop::RakeTask.new do |task| + task.requires << 'rubocop-rspec' +end +``` + +### Code Climate + +rubocop-rspec is available on Code Climate as part of the rubocop engine. [Learn More](https://codeclimate.com/changelog/55a433bbe30ba00852000fac). + +## Documentation + +You can read more about RuboCop-RSpec in its [official manual](http://rubocop-rspec.readthedocs.io). + +## Inspecting files that don't end with `_spec.rb` + +By default, `rubocop-rspec` only inspects code within paths ending in `_spec.rb` or including `spec/`. You can override this setting in your config file by specifying one or more patterns: + +```yaml +# Inspect all files +AllCops: + RSpec: + Patterns: + - '.+' +``` + +```yaml +# Inspect only files ending with `_test.rb` +AllCops: + RSpec: + Patterns: + - '_test.rb$' +``` + +## The Cops + +All cops are located under +[`lib/rubocop/cop/rspec`](lib/rubocop/cop/rspec), and contain +examples/documentation. + +In your `.rubocop.yml`, you may treat the RSpec cops just like any other +cop. For example: + +```yaml +RSpec/FilePath: + Exclude: + - spec/my_poorly_named_spec_file.rb +``` + +## Non-goals of RuboCop RSpec + +### Enforcing `should` vs. `expect` syntax + +Enforcing + +```ruby +expect(calculator.compute(line_item)).to eq(5) +``` + +over + +```ruby +calculator.compute(line_item).should == 5 +``` + +is a feature of RSpec itself – you can read about it in the [RSpec Documentation](https://relishapp.com/rspec/rspec-expectations/docs/syntax-configuration#disable-should-syntax) + +### Enforcing an explicit RSpec receiver for top-level methods (disabling monkey patching) + +Enforcing + +```ruby +Rspec.describe MyClass do + ... +end +``` + +over + +```ruby +describe MyClass do + ... +end +``` + +can be achieved using RSpec's `disable_monkey_patching!` method, which you can read more about in the [RSpec Documentation](https://relishapp.com/rspec/rspec-core/v/3-7/docs/configuration/zero-monkey-patching-mode#monkey-patched-methods-are-undefined-with-%60disable-monkey-patching!%60). This will also prevent `should` from being defined on every object in your system. + +Before disabling `should` you will need all your specs to use the `expect` syntax. You can use [Transpec](http://yujinakayama.me/transpec/), which will do the conversion for you. + +## Contributing + +Checkout the [contribution guidelines](.github/CONTRIBUTING.md). + +## License + +`rubocop-rspec` is MIT licensed. [See the accompanying file](MIT-LICENSE.md) for +the full text. diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/Rakefile b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/Rakefile new file mode 100644 index 0000000000..0ea575738e --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/Rakefile @@ -0,0 +1,85 @@ +require 'open3' + +require 'bundler' +require 'bundler/gem_tasks' + +begin + Bundler.setup(:default, :development) +rescue Bundler::BundlerError => e + warn e.message + warn 'Run `bundle install` to install missing gems' + exit e.status_code +end + +require 'rspec/core/rake_task' + +Dir['tasks/**/*.rake'].each { |t| load t } + +RSpec::Core::RakeTask.new(:spec) do |spec| + spec.pattern = FileList['spec/**/*_spec.rb'] +end + +desc 'Run RSpec with code coverage' +task :coverage do + ENV['COVERAGE'] = 'true' + Rake::Task['spec'].execute +end + +desc 'Run RuboCop over this gem' +task :internal_investigation do + sh('bundle exec rubocop --require rubocop-rspec') +end + +desc 'Build config/default.yml' +task :build_config do + sh('bin/build_config') +end + +desc 'Confirm config/default.yml is up to date' +task confirm_config: :build_config do + _, stdout, _, process = + Open3.popen3('git diff --exit-code config/default.yml') + + unless process.value.success? + raise "default.yml is out of sync:\n\n#{stdout.read}\nRun bin/build_config" + end +end + +desc 'Confirm documentation is up to date' +task confirm_documentation: :generate_cops_documentation do + _, _, _, process = + Open3.popen3('git diff --exit-code manual/') + + unless process.value.success? + raise 'Please run `rake generate_cops_documentation` ' \ + 'and add manual/ to the commit.' + end +end + +task default: %i[build_config coverage + internal_investigation + confirm_config + documentation_syntax_check + confirm_documentation] + +desc 'Generate a new cop template' +task :new_cop, [:cop] do |_task, args| + require 'rubocop' + + cop_name = args.fetch(:cop) do + warn 'usage: bundle exec rake new_cop[Department/Name]' + exit! + end + + github_user = `git config github.user`.chop + github_user = 'your_id' if github_user.empty? + + generator = RuboCop::Cop::Generator.new(cop_name, github_user) + + generator.write_source + generator.write_spec + generator.inject_require(root_file_path: 'lib/rubocop/cop/rspec_cops.rb') + generator.inject_config(config_file_path: 'config/default.yml') + + puts generator.todo +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/config/default.yml b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/config/default.yml similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/config/default.yml rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/config/default.yml diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop-rspec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop-rspec.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop-rspec.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop-rspec.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/align_left_let_brace.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/align_left_let_brace.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/align_left_let_brace.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/align_left_let_brace.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/align_right_let_brace.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/align_right_let_brace.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/align_right_let_brace.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/align_right_let_brace.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/any_instance.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/any_instance.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/any_instance.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/any_instance.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/around_block.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/around_block.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/around_block.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/around_block.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/be.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/be.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/be.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/be.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/be_eql.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/be_eql.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/be_eql.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/be_eql.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/before_after_all.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/before_after_all.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/before_after_all.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/before_after_all.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/capybara/current_path_expectation.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/capybara/current_path_expectation.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/capybara/current_path_expectation.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/capybara/current_path_expectation.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/capybara/feature_methods.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/capybara/feature_methods.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/capybara/feature_methods.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/capybara/feature_methods.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/context_wording.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/context_wording.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/context_wording.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/context_wording.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/cop.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/cop.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/cop.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/cop.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/describe_class.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/describe_class.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/describe_class.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/describe_class.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/describe_method.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/describe_method.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/describe_method.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/describe_method.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/describe_symbol.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/describe_symbol.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/describe_symbol.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/describe_symbol.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/described_class.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/described_class.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/described_class.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/described_class.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/empty_example_group.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/empty_example_group.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/empty_example_group.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/empty_example_group.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/empty_line_after_example_group.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/empty_line_after_example_group.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/empty_line_after_example_group.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/empty_line_after_example_group.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/empty_line_after_final_let.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/empty_line_after_final_let.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/empty_line_after_final_let.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/empty_line_after_final_let.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/empty_line_after_hook.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/empty_line_after_hook.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/empty_line_after_hook.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/empty_line_after_hook.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/empty_line_after_subject.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/empty_line_after_subject.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/empty_line_after_subject.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/empty_line_after_subject.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/example_length.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/example_length.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/example_length.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/example_length.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/example_without_description.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/example_without_description.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/example_without_description.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/example_without_description.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/example_wording.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/example_wording.rb similarity index 96% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/example_wording.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/example_wording.rb index ba8ae11758..fa5f7fea52 100644 --- a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/example_wording.rb +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/example_wording.rb @@ -33,8 +33,8 @@ module RuboCop MSG_SHOULD = 'Do not use should when describing your tests.'.freeze MSG_IT = "Do not repeat 'it' when describing your tests.".freeze - SHOULD_PREFIX = /\Ashould(?:n't)?\b/i - IT_PREFIX = /\Ait /i + SHOULD_PREFIX = /\Ashould(?:n't)?\b/i.freeze + IT_PREFIX = /\Ait /i.freeze def_node_matcher( :it_description, diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/expect_actual.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/expect_actual.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/expect_actual.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/expect_actual.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/expect_change.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/expect_change.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/expect_change.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/expect_change.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/expect_in_hook.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/expect_in_hook.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/expect_in_hook.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/expect_in_hook.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/expect_output.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/expect_output.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/expect_output.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/expect_output.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/factory_bot/create_list.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb similarity index 96% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/factory_bot/create_list.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb index 8eb690609a..6769da2e5b 100644 --- a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/factory_bot/create_list.rb +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb @@ -30,9 +30,10 @@ module RuboCop MSG_CREATE_LIST = 'Prefer create_list.'.freeze MSG_N_TIMES = 'Prefer %s.times.'.freeze - def_node_matcher :n_times_block?, <<-PATTERN + def_node_matcher :n_times_block_without_arg?, <<-PATTERN (block (send (int _) :times) + (args) ... ) PATTERN @@ -47,7 +48,7 @@ module RuboCop def on_block(node) return unless style == :create_list - return unless n_times_block?(node) + return unless n_times_block_without_arg?(node) return unless contains_only_factory?(node.body) add_offense(node.send_node, diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/file_path.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/file_path.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/file_path.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/file_path.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/focus.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/focus.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/focus.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/focus.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/hook_argument.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/hook_argument.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/hook_argument.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/hook_argument.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/hooks_before_examples.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/hooks_before_examples.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/hooks_before_examples.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/hooks_before_examples.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/implicit_expect.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/implicit_expect.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/implicit_expect.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/implicit_expect.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/implicit_subject.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/implicit_subject.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/implicit_subject.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/implicit_subject.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/instance_spy.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/instance_spy.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/instance_spy.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/instance_spy.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/instance_variable.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/instance_variable.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/instance_variable.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/instance_variable.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/invalid_predicate_matcher.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/invalid_predicate_matcher.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/invalid_predicate_matcher.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/invalid_predicate_matcher.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/it_behaves_like.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/it_behaves_like.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/it_behaves_like.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/it_behaves_like.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/iterated_expectation.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/iterated_expectation.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/iterated_expectation.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/iterated_expectation.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/leading_subject.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/leading_subject.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/leading_subject.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/leading_subject.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/let_before_examples.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/let_before_examples.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/let_before_examples.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/let_before_examples.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/let_setup.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/let_setup.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/let_setup.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/let_setup.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/message_chain.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/message_chain.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/message_chain.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/message_chain.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/message_expectation.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/message_expectation.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/message_expectation.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/message_expectation.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/message_spies.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/message_spies.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/message_spies.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/message_spies.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/missing_example_group_argument.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/missing_example_group_argument.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/missing_example_group_argument.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/missing_example_group_argument.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/multiple_describes.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/multiple_describes.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/multiple_describes.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/multiple_describes.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/multiple_expectations.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/multiple_expectations.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/multiple_expectations.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/multiple_expectations.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/multiple_subjects.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/multiple_subjects.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/multiple_subjects.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/multiple_subjects.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/named_subject.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/named_subject.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/named_subject.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/named_subject.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/nested_groups.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/nested_groups.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/nested_groups.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/nested_groups.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/not_to_not.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/not_to_not.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/not_to_not.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/not_to_not.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/overwriting_setup.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/overwriting_setup.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/overwriting_setup.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/overwriting_setup.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/pending.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/pending.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/pending.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/pending.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/predicate_matcher.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/predicate_matcher.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/predicate_matcher.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/predicate_matcher.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/rails/http_status.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/rails/http_status.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/rails/http_status.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/rails/http_status.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/receive_counts.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/receive_counts.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/receive_counts.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/receive_counts.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/receive_never.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/receive_never.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/receive_never.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/receive_never.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/repeated_description.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/repeated_description.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/repeated_description.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/repeated_description.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/repeated_example.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/repeated_example.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/repeated_example.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/repeated_example.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/return_from_stub.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/return_from_stub.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/return_from_stub.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/return_from_stub.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/scattered_let.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/scattered_let.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/scattered_let.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/scattered_let.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/scattered_setup.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/scattered_setup.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/scattered_setup.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/scattered_setup.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/shared_context.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/shared_context.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/shared_context.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/shared_context.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/shared_examples.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/shared_examples.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/shared_examples.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/shared_examples.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/single_argument_message_chain.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/single_argument_message_chain.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/single_argument_message_chain.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/single_argument_message_chain.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/subject_stub.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/subject_stub.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/subject_stub.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/subject_stub.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/unspecified_exception.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/unspecified_exception.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/unspecified_exception.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/unspecified_exception.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/verified_doubles.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/verified_doubles.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/verified_doubles.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/verified_doubles.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/void_expect.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/void_expect.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec/void_expect.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec/void_expect.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec_cops.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec_cops.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/cop/rspec_cops.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/cop/rspec_cops.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/align_let_brace.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/align_let_brace.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/align_let_brace.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/align_let_brace.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/blank_line_separation.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/blank_line_separation.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/blank_line_separation.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/blank_line_separation.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/concept.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/concept.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/concept.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/concept.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/config_formatter.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/config_formatter.rb similarity index 93% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/config_formatter.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/config_formatter.rb index 1cfd9e12c2..8a7e767d58 100644 --- a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/config_formatter.rb +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/config_formatter.rb @@ -4,7 +4,7 @@ module RuboCop module RSpec # Builds a YAML config file from two config hashes class ConfigFormatter - NAMESPACES = /^(RSpec|Capybara|FactoryBot|Rails)/ + NAMESPACES = /^(RSpec|Capybara|FactoryBot|Rails)/.freeze STYLE_GUIDE_BASE_URL = 'http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/'.freeze def initialize(config, descriptions) diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/description_extractor.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/description_extractor.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/description_extractor.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/description_extractor.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/example.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/example.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/example.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/example.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/example_group.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/example_group.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/example_group.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/example_group.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/final_end_location.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/final_end_location.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/final_end_location.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/final_end_location.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/hook.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/hook.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/hook.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/hook.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/inject.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/inject.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/inject.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/inject.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/language.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/language.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/language.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/language.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/language/node_pattern.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/language/node_pattern.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/language/node_pattern.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/language/node_pattern.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/node.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/node.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/node.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/node.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/top_level_describe.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/top_level_describe.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/top_level_describe.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/top_level_describe.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/util.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/util.rb similarity index 100% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/util.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/util.rb diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/version.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/version.rb similarity index 83% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/version.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/version.rb index fac9981953..21b8525922 100644 --- a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/version.rb +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/version.rb @@ -4,7 +4,7 @@ module RuboCop module RSpec # Version information for the RSpec RuboCop plugin. module Version - STRING = '1.30.0'.freeze + STRING = '1.30.1'.freeze end end end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/wording.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/wording.rb similarity index 88% rename from Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/wording.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/wording.rb index 9eb7a05d9d..736c54f482 100644 --- a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib/rubocop/rspec/wording.rb +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib/rubocop/rspec/wording.rb @@ -4,10 +4,10 @@ module RuboCop module RSpec # RSpec example wording rewriter class Wording - SHOULDNT_PREFIX = /\Ashould(?:n't| not)\b/i - SHOULDNT_BE_PREFIX = /#{SHOULDNT_PREFIX} be\b/i - ES_SUFFIX_PATTERN = /(?:o|s|x|ch|sh|z)\z/i - IES_SUFFIX_PATTERN = /[^aeou]y\z/i + SHOULDNT_PREFIX = /\Ashould(?:n't| not)\b/i.freeze + SHOULDNT_BE_PREFIX = /#{SHOULDNT_PREFIX} be\b/i.freeze + ES_SUFFIX_PATTERN = /(?:o|s|x|ch|sh|z)\z/i.freeze + IES_SUFFIX_PATTERN = /[^aeou]y\z/i.freeze def initialize(text, ignore:, replace:) @text = text diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/rubocop-rspec.gemspec b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/rubocop-rspec.gemspec new file mode 100644 index 0000000000..147b8b8871 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/rubocop-rspec.gemspec @@ -0,0 +1,47 @@ +$LOAD_PATH.unshift File.expand_path('lib', __dir__) +require 'rubocop/rspec/version' + +Gem::Specification.new do |spec| + spec.name = 'rubocop-rspec' + spec.summary = 'Code style checking for RSpec files' + spec.description = <<-DESCRIPTION + Code style checking for RSpec files. + A plugin for the RuboCop code style enforcing & linting tool. + DESCRIPTION + spec.homepage = 'https://github.com/rubocop-hq/rubocop-rspec' + spec.authors = ['John Backus', 'Ian MacLeod', 'Nils Gemeinhardt'] + spec.email = [ + 'johncbackus@gmail.com', + 'ian@nevir.net', + 'git@nilsgemeinhardt.de' + ] + spec.licenses = ['MIT'] + + spec.version = RuboCop::RSpec::Version::STRING + spec.platform = Gem::Platform::RUBY + spec.required_ruby_version = '>= 2.2.0' + + spec.require_paths = ['lib'] + spec.files = Dir[ + '{config,lib,spec}/**/*', + '*.md', + '*.gemspec', + 'Gemfile', + 'Rakefile' + ] + spec.test_files = spec.files.grep(%r{^spec/}) + spec.extra_rdoc_files = ['MIT-LICENSE.md', 'README.md'] + + spec.metadata = { + 'changelog_uri' => 'https://github.com/rubocop-hq/rubocop-rspec/blob/master/CHANGELOG.md', + 'documentation_uri' => 'https://rubocop-rspec.readthedocs.io/' + } + + spec.add_runtime_dependency 'rubocop', '>= 0.60.0' + + spec.add_development_dependency 'rack' + spec.add_development_dependency 'rake' + spec.add_development_dependency 'rspec', '>= 3.4' + spec.add_development_dependency 'simplecov' + spec.add_development_dependency 'yard' +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/project/changelog_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/project/changelog_spec.rb new file mode 100644 index 0000000000..628d1a04da --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/project/changelog_spec.rb @@ -0,0 +1,74 @@ +RSpec.describe 'CHANGELOG.md' do + subject(:changelog) { SpecHelper::ROOT.join('CHANGELOG.md').read } + + it 'has link definitions for all implicit links' do + implicit_link_names = changelog.scan(/\[([^\]]+)\]\[\]/).flatten.uniq + implicit_link_names.each do |name| + expect(changelog).to include("[#{name}]: http") + end + end + + describe 'entry' do + subject(:entries) { lines.grep(/^\*/).map(&:chomp) } + + let(:lines) { changelog.each_line } + + it 'has a whitespace between the * and the body' do + expect(entries).to all(match(/^\* \S/)) + end + + it 'has a link to the contributors at the end' do + expect(entries).to all(match(/\(\[@\S+\]\[\](?:, \[@\S+\]\[\])*\)$/)) + end + + describe 'link to related issue on github' do + let(:issues) do + entries.map do |entry| + entry.match(/\[(?[#\d]+)\]\((?[^\)]+)\)/) + end.compact + end + + it 'has an issue number prefixed with #' do + issues.each do |issue| + expect(issue[:number]).to match(/^#\d+$/) + end + end + + it 'has a valid URL' do + issues.each do |issue| + number = issue[:number].gsub(/\D/, '') + pattern = %r{^https://github\.com/.+/.+/(?:issues|pull)/#{number}$} # rubocop:disable LineLength + expect(issue[:url]).to match(pattern) + end + end + + it 'has a colon and a whitespace at the end' do + entries_including_issue_link = entries.select do |entry| + entry.match(/^\*\s*\[/) + end + + expect(entries_including_issue_link).to all(include('): ')) + end + end + + describe 'body' do + let(:bodies) do + entries.map do |entry| + entry + .sub(/^\*\s*(?:\[.+?\):\s*)?/, '') + .sub(/\s*\([^\)]+\)$/, '') + end + end + + it 'does not start with a lower case' do + bodies.each do |body| + expect(body).not_to match(/^[a-z]/) + end + end + + it 'ends with a punctuation' do + expect(bodies).to all(match(/[\.\!]$/)) + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/project/default_config_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/project/default_config_spec.rb new file mode 100644 index 0000000000..4e0f9c00d2 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/project/default_config_spec.rb @@ -0,0 +1,74 @@ +RSpec.describe 'config/default.yml' do + subject(:default_config) do + RuboCop::ConfigLoader.load_file('config/default.yml') + end + + let(:namespaces) do + { + 'rspec' => 'RSpec', + 'capybara' => 'Capybara', + 'factory_bot' => 'FactoryBot', + 'rails' => 'Rails' + } + end + + let(:cop_names) do + glob = SpecHelper::ROOT.join('lib', 'rubocop', 'cop', 'rspec', + '{,capybara,factory_bot,rails}', '*.rb') + cop_names = + Pathname.glob(glob).map do |file| + file_name = file.basename('.rb').to_s + cop_name = file_name.gsub(/(^|_)(.)/) { Regexp.last_match(2).upcase } + namespace = namespaces[file.dirname.basename.to_s] + "#{namespace}/#{cop_name}" + end + + cop_names - %w[RSpec/Cop] + end + + let(:config_keys) do + cop_names + %w[AllCops] + end + + def cop_configuration(config_key) + cop_names.map do |cop_name| + cop_config = default_config[cop_name] + + cop_config.fetch(config_key) do + raise "Expected #{cop_name} to have #{config_key} configuration key" + end + end + end + + it 'has configuration for all cops' do + expect(default_config.keys).to match_array(config_keys) + end + + it 'sorts configuration keys alphabetically' do + namespaces.each do |_path, prefix| + expected = config_keys.select { |key| key.start_with?(prefix) }.sort + actual = default_config.keys.select { |key| key.start_with?(prefix) } + actual.each_with_index do |key, idx| + expect(key).to eq expected[idx] + end + end + end + + it 'has descriptions for all cops' do + expect(cop_configuration('Description')).to all(be_a(String)) + end + + it 'does not have newlines in cop descriptions' do + cop_configuration('Description').each do |value| + expect(value).not_to include("\n") + end + end + + it 'ends every description with a period' do + expect(cop_configuration('Description')).to all(end_with('.')) + end + + it 'includes Enabled: true for every cop' do + expect(cop_configuration('Enabled')).to all(be(true).or(be(false))) + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/project/project_requires_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/project/project_requires_spec.rb new file mode 100644 index 0000000000..1cc414518d --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/project/project_requires_spec.rb @@ -0,0 +1,18 @@ +RSpec.describe 'Project requires' do + it 'alphabetizes cop requires' do + source = SpecHelper::ROOT.join('lib', 'rubocop', 'cop', 'rspec_cops.rb') + captures = source.read.scan(%r{^(require_relative 'rspec/(.*?/)?(.*?)')$}) + + require_statements = captures.map(&:first) + sorted_require_statements = + captures.sort_by do |_require_statement, cop_category, name| + [cop_category || 'rspec', name] + end.map(&:first) + + aggregate_failures do + # Sanity check that we actually discovered require statements. + expect(captures).not_to be_empty + expect(require_statements).to eql(sorted_require_statements) + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/align_left_let_brace_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/align_left_let_brace_spec.rb new file mode 100644 index 0000000000..9f66a13670 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/align_left_let_brace_spec.rb @@ -0,0 +1,66 @@ +RSpec.describe RuboCop::Cop::RSpec::AlignLeftLetBrace do + subject(:cop) { described_class.new } + + it 'registers offense for unaligned braces' do + expect_offense(<<-RUBY) + let(:foo) { bar } + ^ Align left let brace + let(:hi) { baz } + ^ Align left let brace + let(:blahblah) { baz } + + let(:thing) { ignore_this } + let(:other) { + ignore_this_too + } + + describe 'blah' do + let(:blahblah) { baz } + let(:blah) { thing } + ^ Align left let brace + let(:a) { thing } + ^ Align left let brace + end + RUBY + end + + it 'works with empty file' do + expect_no_offenses('') + end + + offensive_source = <<-RUBY + let(:foo) { bar } + let(:hi) { baz } + let(:blahblah) { baz } + + let(:thing) { ignore_this } + let(:other) { + ignore_this_too + } + + describe 'blah' do + let(:long_name) { thing } + let(:blah) { thing } + let(:a) { thing } + end + RUBY + + corrected_source = <<-RUBY + let(:foo) { bar } + let(:hi) { baz } + let(:blahblah) { baz } + + let(:thing) { ignore_this } + let(:other) { + ignore_this_too + } + + describe 'blah' do + let(:long_name) { thing } + let(:blah) { thing } + let(:a) { thing } + end + RUBY + + include_examples 'autocorrect', offensive_source, corrected_source +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/align_right_let_brace_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/align_right_let_brace_spec.rb new file mode 100644 index 0000000000..4b3763dad2 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/align_right_let_brace_spec.rb @@ -0,0 +1,66 @@ +RSpec.describe RuboCop::Cop::RSpec::AlignRightLetBrace do + subject(:cop) { described_class.new } + + it 'registers offense for unaligned braces' do + expect_offense(<<-RUBY) + let(:foo) { a } + ^ Align right let brace + let(:hi) { ab } + ^ Align right let brace + let(:blahblah) { abcd } + + let(:thing) { ignore_this } + let(:other) { + ignore_this_too + } + + describe 'blah' do + let(:blahblah) { a } + ^ Align right let brace + let(:blah) { bc } + ^ Align right let brace + let(:a) { abc } + end + RUBY + end + + it 'works with empty file' do + expect_no_offenses('') + end + + offensive_source = <<-RUBY + let(:foo) { a } + let(:hi) { ab } + let(:blahblah) { abcd } + + let(:thing) { ignore_this } + let(:other) { + ignore_this_too + } + + describe 'blah' do + let(:blahblah) { a } + let(:blah) { bc } + let(:a) { abc } + end + RUBY + + corrected_source = <<-RUBY + let(:foo) { a } + let(:hi) { ab } + let(:blahblah) { abcd } + + let(:thing) { ignore_this } + let(:other) { + ignore_this_too + } + + describe 'blah' do + let(:blahblah) { a } + let(:blah) { bc } + let(:a) { abc } + end + RUBY + + include_examples 'autocorrect', offensive_source, corrected_source +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/any_instance_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/any_instance_spec.rb new file mode 100644 index 0000000000..64df1acc65 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/any_instance_spec.rb @@ -0,0 +1,30 @@ +RSpec.describe RuboCop::Cop::RSpec::AnyInstance do + subject(:cop) { described_class.new } + + it 'finds `allow_any_instance_of` instead of an instance double' do + expect_offense(<<-RUBY) + before do + allow_any_instance_of(Object).to receive(:foo) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Avoid stubbing using `allow_any_instance_of`. + end + RUBY + end + + it 'finds `expect_any_instance_of` instead of an instance double' do + expect_offense(<<-RUBY) + before do + expect_any_instance_of(Object).to receive(:foo) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Avoid stubbing using `expect_any_instance_of`. + end + RUBY + end + + it 'finds old `any_instance` syntax instead of an instance double' do + expect_offense(<<-RUBY) + before do + Object.any_instance.should_receive(:foo) + ^^^^^^^^^^^^^^^^^^^ Avoid stubbing using `any_instance`. + end + RUBY + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/around_block_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/around_block_spec.rb new file mode 100644 index 0000000000..924ad15061 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/around_block_spec.rb @@ -0,0 +1,119 @@ +RSpec.describe RuboCop::Cop::RSpec::AroundBlock do + subject(:cop) { described_class.new } + + context 'when no value is yielded' do + it 'registers an offense' do + expect_offense(<<-RUBY) + around do + ^^^^^^^^^ Test object should be passed to around block. + do_something + end + RUBY + end + end + + context 'when the hook is scoped with a symbol' do + it 'registers an offense' do + expect_offense(<<-RUBY) + around(:each) do + ^^^^^^^^^^^^^^^^ Test object should be passed to around block. + do_something + end + RUBY + end + end + + context 'when the yielded value is unused' do + it 'registers an offense' do + expect_offense(<<-RUBY) + around do |test| + ^^^^ You should call `test.call` or `test.run`. + do_something + end + RUBY + end + end + + context 'when two values are yielded and the first is unused' do + it 'registers an offense for the first argument' do + expect_offense(<<-RUBY) + around do |test, unused| + ^^^^ You should call `test.call` or `test.run`. + unused.run + end + RUBY + end + end + + context 'when the yielded value is referenced but not used' do + it 'registers an offense' do + expect_offense(<<-RUBY) + around do |test| + ^^^^ You should call `test.call` or `test.run`. + test + end + RUBY + end + end + + context 'when a method other than #run or #call is called' do + it 'registers an offense' do + expect_offense(<<-RUBY) + around do |test| + ^^^^ You should call `test.call` or `test.run`. + test.inspect + end + RUBY + end + end + + context 'when #run is called' do + it 'does not register an offense' do + expect_no_offenses(<<-RUBY) + around do |test| + test.run + end + RUBY + end + end + + context 'when #call is called' do + it 'does not register an offense' do + expect_no_offenses(<<-RUBY) + around do |test| + test.call + end + RUBY + end + end + + context 'when used as a block arg' do + it 'does not register an offense' do + expect_no_offenses(<<-RUBY) + around do |test| + 1.times(&test) + end + RUBY + end + end + + context 'when passed to another method' do + it 'does not register an offense' do + expect_no_offenses(<<-RUBY) + around do |test| + something_that_might_run_test(test, another_arg) + end + RUBY + end + end + + context 'when yielded to another block' do + it 'does not register an offense' do + expect_no_offenses(<<-RUBY) + around do |test| + foo { yield(some_arg, test) } + end + RUBY + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/be_eql_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/be_eql_spec.rb new file mode 100644 index 0000000000..fb624f3dee --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/be_eql_spec.rb @@ -0,0 +1,60 @@ +RSpec.describe RuboCop::Cop::RSpec::BeEql do + subject(:cop) { described_class.new } + + it 'registers an offense for `eql` when argument is a boolean' do + expect_offense(<<-RUBY) + it { expect(foo).to eql(true) } + ^^^ Prefer `be` over `eql`. + it { expect(foo).to eql(false) } + ^^^ Prefer `be` over `eql`. + RUBY + end + + it 'registers an offense for `eql` when argument is an integer' do + expect_offense(<<-RUBY) + it { expect(foo).to eql(0) } + ^^^ Prefer `be` over `eql`. + it { expect(foo).to eql(123) } + ^^^ Prefer `be` over `eql`. + RUBY + end + + it 'registers an offense for `eql` when argument is a float' do + expect_offense(<<-RUBY) + it { expect(foo).to eql(1.0) } + ^^^ Prefer `be` over `eql`. + it { expect(foo).to eql(1.23) } + ^^^ Prefer `be` over `eql`. + RUBY + end + + it 'registers an offense for `eql` when argument is a symbol' do + expect_offense(<<-RUBY) + it { expect(foo).to eql(:foo) } + ^^^ Prefer `be` over `eql`. + RUBY + end + + it 'registers an offense for `eql` when argument is nil' do + expect_offense(<<-RUBY) + it { expect(foo).to eql(nil) } + ^^^ Prefer `be` over `eql`. + RUBY + end + + it 'does not register an offense for `eql` when argument is a string' do + expect_no_offenses(<<-RUBY) + it { expect(foo).to eql('foo') } + RUBY + end + + it 'does not register an offense for `eql` when expectation is negated' do + expect_no_offenses(<<-RUBY) + it { expect(foo).to_not eql(1) } + RUBY + end + + include_examples 'autocorrect', + 'it { expect(foo).to eql(1) }', + 'it { expect(foo).to be(1) }' +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/be_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/be_spec.rb new file mode 100644 index 0000000000..16d1a95afb --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/be_spec.rb @@ -0,0 +1,33 @@ +RSpec.describe RuboCop::Cop::RSpec::Be do + subject(:cop) { described_class.new } + + it 'registers an offense for `be` without an argument' do + expect_offense(<<-RUBY) + it { expect(foo).to be } + ^^ Don't use `be` without an argument. + RUBY + end + + it 'registers an offense for not_to be' do + expect_offense(<<-RUBY) + it { expect(foo).not_to be } + ^^ Don't use `be` without an argument. + it { expect(foo).to_not be } + ^^ Don't use `be` without an argument. + RUBY + end + + it 'allows `be` with an argument' do + expect_no_offenses(<<-RUBY) + it { expect(foo).to be(1) } + it { expect(foo).not_to be(0) } + RUBY + end + + it 'allows specific `be_` matchers' do + expect_no_offenses(<<-RUBY) + it { expect(foo).to be_truthy } + it { expect(foo).not_to be_falsy } + RUBY + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/before_after_all_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/before_after_all_spec.rb new file mode 100644 index 0000000000..f74a6c86a7 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/before_after_all_spec.rb @@ -0,0 +1,50 @@ +RSpec.describe RuboCop::Cop::RSpec::BeforeAfterAll do + subject(:cop) { described_class.new } + + def message(hook) + "Beware of using `#{hook}` as it may cause state to leak between tests. "\ + 'If you are using `rspec-rails`, and `use_transactional_fixtures` is '\ + "enabled, then records created in `#{hook}` are not automatically rolled "\ + 'back.' + end + + context 'when using before all' do + it 'registers an offense' do + expect_offense(<<-RUBY) + before(:all) { do_something } + ^^^^^^^^^^^^ #{message('before(:all)')} + before(:context) { do_something } + ^^^^^^^^^^^^^^^^ #{message('before(:context)')} + RUBY + end + end + + context 'when using after all' do + it 'registers an offense' do + expect_offense(<<-RUBY) + after(:all) { do_something } + ^^^^^^^^^^^ #{message('after(:all)')} + after(:context) { do_something } + ^^^^^^^^^^^^^^^ #{message('after(:context)')} + RUBY + end + end + + context 'when using before each' do + it 'does not register an offense' do + expect_no_offenses(<<-RUBY) + before(:each) { do_something } + before(:example) { do_something } + RUBY + end + end + + context 'when using after each' do + it 'does not register an offense' do + expect_no_offenses(<<-RUBY) + after(:each) { do_something } + after(:example) { do_something } + RUBY + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/capybara/current_path_expectation_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/capybara/current_path_expectation_spec.rb new file mode 100644 index 0000000000..a5c598df7a --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/capybara/current_path_expectation_spec.rb @@ -0,0 +1,29 @@ +RSpec.describe RuboCop::Cop::RSpec::Capybara::CurrentPathExpectation do + subject(:cop) { described_class.new } + + it 'flags violations for `expect(current_path)`' do + expect_offense(<<-RUBY) + expect(current_path).to eq("/callback") + ^^^^^^ Do not set an RSpec expectation on `current_path` in Capybara feature specs - instead, use the `have_current_path` matcher on `page` + RUBY + end + + it 'flags violations for `expect(page.current_path)`' do + expect_offense(<<-RUBY) + expect(page.current_path).to eq("/callback") + ^^^^^^ Do not set an RSpec expectation on `current_path` in Capybara feature specs - instead, use the `have_current_path` matcher on `page` + RUBY + end + + it "doesn't flag a violation for other expectations" do + expect_no_offenses(<<-RUBY) + expect(current_user).to eq(user) + RUBY + end + + it "doesn't flag a violation for other references to `current_path`" do + expect_no_offenses(<<-RUBY) + current_path = WalkingRoute.last.path + RUBY + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/capybara/feature_methods_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/capybara/feature_methods_spec.rb new file mode 100644 index 0000000000..5aa4de80c7 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/capybara/feature_methods_spec.rb @@ -0,0 +1,128 @@ +RSpec.describe RuboCop::Cop::RSpec::Capybara::FeatureMethods, :config do + subject(:cop) { described_class.new(config) } + + let(:cop_config) { { 'EnabledMethods' => [] } } + + it 'flags violations for `background`' do + expect_offense(<<-RUBY) + describe 'some feature' do + background do; end + ^^^^^^^^^^ Use `before` instead of `background`. + end + RUBY + end + + it 'flags violations for `scenario`' do + expect_offense(<<-RUBY) + RSpec.describe 'some feature' do + scenario 'Foo' do; end + ^^^^^^^^ Use `it` instead of `scenario`. + end + RUBY + end + + it 'flags violations for `xscenario`' do + expect_offense(<<-RUBY) + describe 'Foo' do + RSpec.xscenario 'Baz' do; end + ^^^^^^^^^ Use `xit` instead of `xscenario`. + end + RUBY + end + + it 'flags violations for `given`' do + expect_offense(<<-RUBY) + RSpec.describe 'Foo' do + given(:foo) { :foo } + ^^^^^ Use `let` instead of `given`. + end + RUBY + end + + it 'flags violations for `given!`' do + expect_offense(<<-RUBY) + describe 'Foo' do + given!(:foo) { :foo } + ^^^^^^ Use `let!` instead of `given!`. + end + RUBY + end + + it 'flags violations for `feature`' do + expect_offense(<<-RUBY) + RSpec.feature 'Foo' do; end + ^^^^^^^ Use `describe` instead of `feature`. + RUBY + end + + it 'ignores variables inside examples' do + expect_no_offenses(<<-RUBY) + it 'is valid code' do + given(feature) + assign(background) + run scenario + end + RUBY + end + + it 'ignores feature calls outside spec' do + expect_no_offenses(<<-RUBY) + FactoryBot.define do + factory :company do + feature { "a company" } + background { Faker::Lorem.sentence } + end + end + RUBY + end + + it 'allows includes before the spec' do + expect_offense(<<-RUBY) + require 'rails_helper' + + RSpec.feature 'Foo' do; end + ^^^^^^^ Use `describe` instead of `feature`. + RUBY + end + + context 'with configured `EnabledMethods`' do + let(:cop_config) { { 'EnabledMethods' => %w[feature] } } + + it 'ignores usage of the enabled method' do + expect_no_offenses(<<-RUBY) + RSpec.feature 'feature is enabled' do; end + RUBY + end + + it 'flags other methods' do + expect_offense(<<-RUBY) + RSpec.feature 'feature is enabled' do + given(:foo) { :foo } + ^^^^^ Use `let` instead of `given`. + end + RUBY + end + end + + shared_examples 'autocorrect_spec' do |original, corrected| + original = <<-RUBY + describe Foo do + #{original} + end + RUBY + corrected = <<-RUBY + describe Foo do + #{corrected} + end + RUBY + + include_examples 'autocorrect', original, corrected + end + + include_examples 'autocorrect_spec', 'background { }', 'before { }' + include_examples 'autocorrect_spec', 'scenario { }', 'it { }' + include_examples 'autocorrect_spec', 'xscenario { }', 'xit { }' + include_examples 'autocorrect_spec', 'given(:foo) { }', 'let(:foo) { }' + include_examples 'autocorrect_spec', 'given!(:foo) { }', 'let!(:foo) { }' + include_examples 'autocorrect_spec', 'RSpec.feature { }', 'RSpec.describe { }' +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/context_wording_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/context_wording_spec.rb new file mode 100644 index 0000000000..a110c42975 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/context_wording_spec.rb @@ -0,0 +1,62 @@ +RSpec.describe RuboCop::Cop::RSpec::ContextWording, :config do + subject(:cop) { described_class.new(config) } + + let(:cop_config) { { 'Prefixes' => %w[when with] } } + + it 'skips describe blocks' do + expect_no_offenses(<<-RUBY) + describe 'the display name not present' do + end + RUBY + end + + it 'finds context without `when` at the beginning' do + expect_offense(<<-RUBY) + context 'the display name not present' do + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Start context description with 'when', or 'with'. + end + RUBY + end + + it 'finds shared_context without `when` at the beginning' do + expect_offense(<<-RUBY) + shared_context 'the display name not present' do + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Start context description with 'when', or 'with'. + end + RUBY + end + + it "skips descriptions beginning with 'when'" do + expect_no_offenses(<<-RUBY) + context 'when the display name is not present' do + end + RUBY + end + + it 'finds context without separate `when` at the beginning' do + expect_offense(<<-RUBY) + context 'whenever you do' do + ^^^^^^^^^^^^^^^^^ Start context description with 'when', or 'with'. + end + RUBY + end + + context 'when configured' do + let(:cop_config) { { 'Prefixes' => %w[if] } } + + it 'finds context without whitelisted prefixes at the beginning' do + expect_offense(<<-RUBY) + context 'when display name is present' do + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Start context description with 'if'. + end + RUBY + end + + it 'skips descriptions with whitelisted prefixes at the beginning' do + expect_no_offenses(<<-RUBY) + context 'if display name is present' do + end + RUBY + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/cop_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/cop_spec.rb new file mode 100644 index 0000000000..33c1094567 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/cop_spec.rb @@ -0,0 +1,95 @@ +# frozen_string_literal: true + +RSpec.describe RuboCop::Cop::RSpec::Cop do + subject(:cop) { fake_cop.new(config) } + + let(:config) do + rubocop_config = + { + 'AllCops' => { + 'RSpec' => { + 'Patterns' => rspec_patterns + } + }, + 'RSpec/FakeCop' => { + 'Exclude' => %w[bar_spec.rb] + } + } + + RuboCop::Config.new(rubocop_config, 'fake_cop_config.yml') + end + + let(:fake_cop) do + stub_const('RuboCop::RSpec', Module.new) + # rubocop:disable ClassAndModuleChildren + class RuboCop::RSpec::FakeCop < described_class + def on_send(node) + add_offense(node, location: :expression, message: 'I flag everything') + end + end + # rubocop:enable ClassAndModuleChildren + RuboCop::RSpec::FakeCop + end + + let(:rspec_patterns) { ['_spec.rb$', '(?:^|/)spec/'] } + + context 'when the source path ends with `_spec.rb`' do + it 'registers an offense' do + expect_offense(<<-RUBY, 'foo_spec.rb') + foo(1) + ^^^^^^ I flag everything + RUBY + end + + it 'ignores the file if it is ignored' do + expect_no_offenses(<<-RUBY, 'bar_spec.rb') + foo(1) + RUBY + end + end + + context 'when the source path contains `/spec/`' do + it 'registers an offense' do + expect_offense(<<-RUBY, '/spec/support/thing.rb') + foo(1) + ^^^^^^ I flag everything + RUBY + end + end + + context 'when the source path starts with `spec/`' do + it 'registers an offense' do + expect_offense(<<-RUBY, 'spec/support/thing.rb') + foo(1) + ^^^^^^ I flag everything + RUBY + end + end + + context 'when the file is a source file without "spec" in the name' do + it 'ignores the source when the path is not a spec file' do + expect_no_offenses(<<-RUBY, 'foo.rb') + foo(1) + RUBY + end + + it 'ignores the source when the path is not a specified pattern' do + expect_no_offenses(<<-RUBY, 'foo_test.rb') + foo(1) + RUBY + end + end + + context 'when custom patterns are specified' do + let(:rspec_patterns) do + ['_test\.rb$'] + end + + it 'registers offenses when the path matches a custom specified pattern' do + expect_offense(<<-RUBY, 'foo_test.rb') + foo(1) + ^^^^^^ I flag everything + RUBY + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/describe_class_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/describe_class_spec.rb new file mode 100644 index 0000000000..1cc02c480e --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/describe_class_spec.rb @@ -0,0 +1,159 @@ +RSpec.describe RuboCop::Cop::RSpec::DescribeClass do + subject(:cop) { described_class.new } + + it 'checks first-line describe statements' do + expect_offense(<<-RUBY) + describe "bad describe" do + ^^^^^^^^^^^^^^ The first argument to describe should be the class or module being tested. + end + RUBY + end + + it 'supports RSpec.describe' do + expect_no_offenses(<<-RUBY) + RSpec.describe Foo do + end + RUBY + end + + it 'checks describe statements after a require' do + expect_offense(<<-RUBY) + require 'spec_helper' + describe "bad describe" do + ^^^^^^^^^^^^^^ The first argument to describe should be the class or module being tested. + end + RUBY + end + + it 'checks highlights the first argument of a describe' do + expect_offense(<<-RUBY) + describe "bad describe", "blah blah" do + ^^^^^^^^^^^^^^ The first argument to describe should be the class or module being tested. + end + RUBY + end + + it 'ignores nested describe statements' do + expect_no_offenses(<<-RUBY) + describe Some::Class do + describe "bad describe" do + end + end + RUBY + end + + it 'ignores request specs' do + expect_no_offenses(<<-RUBY) + describe 'my new feature', type: :request do + end + RUBY + end + + it 'ignores feature specs' do + expect_no_offenses(<<-RUBY) + describe 'my new feature', type: :feature do + end + RUBY + end + + it 'ignores system specs' do + expect_no_offenses(<<-RUBY) + describe 'my new system test', type: :system do + end + RUBY + end + + it 'ignores feature specs when RSpec.describe is used' do + expect_no_offenses(<<-RUBY) + RSpec.describe 'my new feature', type: :feature do + end + RUBY + end + + it 'flags specs with non :type metadata' do + expect_offense(<<-RUBY) + describe 'my new feature', foo: :feature do + ^^^^^^^^^^^^^^^^ The first argument to describe should be the class or module being tested. + end + RUBY + end + + it 'flags normal metadata in describe' do + expect_offense(<<-RUBY) + describe 'my new feature', blah, type: :wow do + ^^^^^^^^^^^^^^^^ The first argument to describe should be the class or module being tested. + end + RUBY + end + + it 'ignores feature specs - also with complex options' do + expect_no_offenses(<<-RUBY) + describe 'my new feature', :test, :type => :feature, :foo => :bar do + end + RUBY + end + + it 'ignores an empty describe' do + expect_no_offenses(<<-RUBY) + RSpec.describe do + end + + describe do + end + RUBY + end + + it 'ignores routing specs' do + expect_no_offenses(<<-RUBY) + describe 'my new route', type: :routing do + end + RUBY + end + + it 'ignores view specs' do + expect_no_offenses(<<-RUBY) + describe 'widgets/index', type: :view do + end + RUBY + end + + it "doesn't blow up on single-line describes" do + expect_no_offenses('describe Some::Class') + end + + it "doesn't flag top level describe in a shared example" do + expect_no_offenses(<<-RUBY) + shared_examples 'Common::Interface' do + describe '#public_interface' do + it 'conforms to interface' do + # ... + end + end + end + RUBY + end + + it "doesn't flag top level describe in a shared context" do + expect_no_offenses(<<-RUBY) + RSpec.shared_context 'Common::Interface' do + describe '#public_interface' do + it 'conforms to interface' do + # ... + end + end + end + RUBY + end + + it "doesn't flag top level describe in an unnamed shared context" do + expect_no_offenses(<<-RUBY) + shared_context do + describe '#public_interface' do + it 'conforms to interface' do + # ... + end + end + end + RUBY + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/describe_method_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/describe_method_spec.rb new file mode 100644 index 0000000000..f8da4b7b71 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/describe_method_spec.rb @@ -0,0 +1,32 @@ +RSpec.describe RuboCop::Cop::RSpec::DescribeMethod do + subject(:cop) { described_class.new } + + it 'ignores describes with only a class' do + expect_no_offenses('describe Some::Class do; end') + end + + it 'enforces non-method names' do + expect_offense(<<-RUBY) + describe Some::Class, 'nope', '.incorrect_usage' do + ^^^^^^ The second argument to describe should be the method being tested. '#instance' or '.class'. + end + RUBY + end + + it 'skips methods starting with a . or #' do + expect_no_offenses(<<-RUBY) + describe Some::Class, '.asdf' do + end + + describe Some::Class, '#fdsa' do + end + RUBY + end + + it 'skips specs not having a string second argument' do + expect_no_offenses(<<-RUBY) + describe Some::Class, :config do + end + RUBY + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/describe_symbol_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/describe_symbol_spec.rb new file mode 100644 index 0000000000..b51603c595 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/describe_symbol_spec.rb @@ -0,0 +1,42 @@ +RSpec.describe RuboCop::Cop::RSpec::DescribeSymbol do + subject(:cop) { described_class.new } + + it 'flags violations for `describe :symbol`' do + expect_offense(<<-RUBY) + describe(:some_method) { } + ^^^^^^^^^^^^ Avoid describing symbols. + RUBY + end + + it 'flags violations for `describe :symbol` with multiple arguments' do + expect_offense(<<-RUBY) + describe(:some_method, "description") { } + ^^^^^^^^^^^^ Avoid describing symbols. + RUBY + end + + it 'flags violations for `RSpec.describe :symbol`' do + expect_offense(<<-RUBY) + RSpec.describe(:some_method, "description") { } + ^^^^^^^^^^^^ Avoid describing symbols. + RUBY + end + + it 'flags violations for a nested `describe`' do + expect_offense(<<-RUBY) + RSpec.describe Foo do + describe :to_s do + ^^^^^ Avoid describing symbols. + end + end + RUBY + end + + it 'does not flag non-Symbol arguments' do + expect_no_offenses('describe("#some_method") { }') + end + + it 'does not flag `context :symbol`' do + expect_no_offenses('context(:some_method) { }') + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/described_class_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/described_class_spec.rb new file mode 100644 index 0000000000..5b87bf9b04 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/described_class_spec.rb @@ -0,0 +1,304 @@ +RSpec.describe RuboCop::Cop::RSpec::DescribedClass, :config do + subject(:cop) { described_class.new(config) } + + let(:cop_config) do + { 'EnforcedStyle' => enforced_style } + end + + shared_examples 'SkipBlocks enabled' do + it 'does not flag violations within non-rspec blocks' do + expect_offense(<<-RUBY) + describe MyClass do + controller(ApplicationController) do + bar = MyClass + end + + before do + MyClass + ^^^^^^^ Use `described_class` instead of `MyClass`. + + Foo.custom_block do + MyClass + end + end + end + RUBY + end + end + + shared_examples 'SkipBlocks disabled' do + it 'flags violations within all blocks' do + expect_offense(<<-RUBY) + describe MyClass do + controller(ApplicationController) do + bar = MyClass + ^^^^^^^ Use `described_class` instead of `MyClass`. + end + + before(:each) do + MyClass + ^^^^^^^ Use `described_class` instead of `MyClass`. + + Foo.custom_block do + MyClass + ^^^^^^^ Use `described_class` instead of `MyClass`. + end + end + end + RUBY + end + end + + context 'when SkipBlocks is `true`' do + let(:cop_config) { { 'SkipBlocks' => true } } + + include_examples 'SkipBlocks enabled' + end + + context 'when SkipBlocks anything besides `true`' do + let(:cop_config) { { 'SkipBlocks' => 'yes' } } + + include_examples 'SkipBlocks disabled' + end + + context 'when SkipBlocks is not set' do + let(:cop_config) { {} } + + include_examples 'SkipBlocks disabled' + end + + context 'when SkipBlocks is `false`' do + let(:cop_config) { { 'SkipBlocks' => false } } + + include_examples 'SkipBlocks disabled' + end + + context 'when EnforcedStyle is :described_class' do + let(:enforced_style) { :described_class } + + it 'checks for the use of the described class' do + expect_offense(<<-RUBY) + describe MyClass do + include MyClass + ^^^^^^^ Use `described_class` instead of `MyClass`. + + subject { MyClass.do_something } + ^^^^^^^ Use `described_class` instead of `MyClass`. + + before { MyClass.do_something } + ^^^^^^^ Use `described_class` instead of `MyClass`. + end + RUBY + end + + it 'ignores described class as string' do + expect_no_offenses(<<-RUBY) + describe MyClass do + subject { "MyClass" } + end + RUBY + end + + it 'ignores describe that do not reference to a class' do + expect_no_offenses(<<-RUBY) + describe "MyClass" do + subject { "MyClass" } + end + RUBY + end + + it 'ignores class if the scope is changing' do + expect_no_offenses(<<-RUBY) + describe MyClass do + Class.new { foo = MyClass } + Module.new { bar = MyClass } + + def method + include MyClass + end + + class OtherClass + include MyClass + end + + module MyModle + include MyClass + end + end + RUBY + end + + it 'only takes class from top level describes' do + expect_offense(<<-RUBY) + describe MyClass do + describe MyClass::Foo do + subject { MyClass::Foo } + + let(:foo) { MyClass } + ^^^^^^^ Use `described_class` instead of `MyClass`. + end + end + RUBY + end + + it 'ignores subclasses' do + expect_no_offenses(<<-RUBY) + describe MyClass do + subject { MyClass::SubClass } + end + RUBY + end + + it 'ignores if namespace is not matching' do + expect_no_offenses(<<-RUBY) + describe MyNamespace::MyClass do + subject { ::MyClass } + let(:foo) { MyClass } + end + RUBY + end + + it 'checks for the use of described class with namespace' do + expect_offense(<<-RUBY) + describe MyNamespace::MyClass do + subject { MyNamespace::MyClass } + ^^^^^^^^^^^^^^^^^^^^ Use `described_class` instead of `MyNamespace::MyClass`. + end + RUBY + end + + it 'does not flag violations within a class scope change' do + expect_no_offenses(<<-RUBY) + describe MyNamespace::MyClass do + before do + class Foo + thing = MyNamespace::MyClass.new + end + end + end + RUBY + end + + it 'does not flag violations within a hook scope change' do + expect_no_offenses(<<-RUBY) + describe do + before do + MyNamespace::MyClass.new + end + end + RUBY + end + + it 'checks for the use of described class with module' do + pending + + expect_offense(<<-RUBY) + module MyNamespace + describe MyClass do + subject { MyNamespace::MyClass } + ^^^^^^^^^^^^^^^^^^^^ Use `described_class` instead of `MyNamespace::MyClass` + end + end + RUBY + end + + it 'accepts an empty block' do + expect_no_offenses(<<-RUBY) + describe MyClass do + end + RUBY + end + + include_examples 'autocorrect', + 'describe(Foo) { include Foo }', + 'describe(Foo) { include described_class }' + + include_examples 'autocorrect', + 'describe(Foo) { subject { Foo.do_action } }', + 'describe(Foo) { subject { described_class.do_action } }' + + include_examples 'autocorrect', + 'describe(Foo) { before { Foo.do_action } }', + 'describe(Foo) { before { described_class.do_action } }' + end + + context 'when EnforcedStyle is :explicit' do + let(:enforced_style) { :explicit } + + it 'checks for the use of the described_class' do + expect_offense(<<-RUBY) + describe MyClass do + include described_class + ^^^^^^^^^^^^^^^ Use `MyClass` instead of `described_class`. + + subject { described_class.do_something } + ^^^^^^^^^^^^^^^ Use `MyClass` instead of `described_class`. + + before { described_class.do_something } + ^^^^^^^^^^^^^^^ Use `MyClass` instead of `described_class`. + end + RUBY + end + + it 'ignores described_class as string' do + expect_no_offenses(<<-RUBY) + describe MyClass do + subject { "described_class" } + end + RUBY + end + + it 'ignores describe that do not reference to a class' do + expect_no_offenses(<<-RUBY) + describe "MyClass" do + subject { described_class } + end + RUBY + end + + it 'does not flag violations within a class scope change' do + expect_no_offenses(<<-RUBY) + describe MyNamespace::MyClass do + before do + class Foo + thing = described_class.new + end + end + end + RUBY + end + + it 'does not flag violations within a hook scope change' do + expect_no_offenses(<<-RUBY) + describe do + before do + described_class.new + end + end + RUBY + end + + include_examples 'autocorrect', + 'describe(Foo) { include described_class }', + 'describe(Foo) { include Foo }' + + include_examples 'autocorrect', + 'describe(Foo) { subject { described_class.do_action } }', + 'describe(Foo) { subject { Foo.do_action } }' + + include_examples 'autocorrect', + 'describe(Foo) { before { described_class.do_action } }', + 'describe(Foo) { before { Foo.do_action } }' + + original = <<-RUBY + describe(Foo) { include described_class } + describe(Bar) { include described_class } + RUBY + corrected = <<-RUBY + describe(Foo) { include Foo } + describe(Bar) { include Bar } + RUBY + + include_examples 'autocorrect', original, corrected + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/empty_example_group_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/empty_example_group_spec.rb new file mode 100644 index 0000000000..33fe296708 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/empty_example_group_spec.rb @@ -0,0 +1,93 @@ +# frozen_string_literal: true + +RSpec.describe RuboCop::Cop::RSpec::EmptyExampleGroup, :config do + subject(:cop) { described_class.new(config) } + + it 'flags an empty context' do + expect_offense(<<-RUBY) + describe Foo do + context 'when bar' do + ^^^^^^^^^^^^^^^^^^ Empty example group detected. + + let(:foo) { bar } + end + + describe '#thingy?' do + specify do + expect(whatever.thingy?).to be(true) + end + end + + it { should be_true } + end + RUBY + end + + it 'flags an empty top level describe' do + expect_offense(<<-RUBY) + describe Foo do + ^^^^^^^^^^^^ Empty example group detected. + end + RUBY + end + + it 'does not flag include_examples' do + expect_no_offenses(<<-RUBY) + describe Foo do + context "when something is true" do + include_examples "some expectations" + end + + context "when something else is true" do + include_context "some expectations" + end + + context "when a third thing is true" do + it_behaves_like "some thingy" + end + end + RUBY + end + + it 'does not flag methods matching example group names' do + expect_no_offenses(<<-RUBY) + describe Foo do + it 'yields a block when given' do + value = nil + + helper.feature('whatevs') { value = 5 } + + expect(value).to be 5 + end + end + RUBY + end + + it 'does not recognize custom include methods by default' do + expect_offense(<<-RUBY) + describe Foo do + ^^^^^^^^^^^^ Empty example group detected. + context "when I do something clever" do + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Empty example group detected. + it_has_special_behavior + end + end + RUBY + end + + context 'when a custom include method is specified' do + let(:cop_config) do + { 'CustomIncludeMethods' => %w[it_has_special_behavior] } + end + + it 'does not flag an otherwise empty example group' do + expect_no_offenses(<<-RUBY) + describe Foo do + context "when I do something clever" do + it_has_special_behavior + end + end + RUBY + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/empty_line_after_example_group_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/empty_line_after_example_group_spec.rb new file mode 100644 index 0000000000..b92b126171 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/empty_line_after_example_group_spec.rb @@ -0,0 +1,102 @@ +# frozen_string_literal: true + +RSpec.describe RuboCop::Cop::RSpec::EmptyLineAfterExampleGroup do + subject(:cop) { described_class.new } + + it 'checks for empty line after describe' do + expect_offense(<<-RUBY) + RSpec.describe Foo do + describe '#bar' do + end + ^^^ Add an empty line after `describe`. + describe '#baz' do + end + end + RUBY + end + + it 'highlights single line formulations correctly' do + expect_offense(<<-RUBY) + RSpec.describe Foo do + describe('#bar') { } + ^^^^^^^^^^^^^^^^^^^^ Add an empty line after `describe`. + describe '#baz' do + end + end + RUBY + end + + it 'checks for empty line after context' do + expect_offense(<<-RUBY) + RSpec.context 'foo' do + context 'bar' do + end + ^^^ Add an empty line after `context`. + context 'baz' do + end + end + RUBY + end + + it 'approves empty line after describe' do + expect_no_offenses(<<-RUBY) + RSpec.describe Foo do + describe '#bar' do + end + + describe '#baz' do + end + end + RUBY + end + + it 'approves empty line after context' do + expect_no_offenses(<<-RUBY) + RSpec.context 'foo' do + context 'bar' do + end + + context 'baz' do + end + end + RUBY + end + + it 'handles describes in an if block' do + expect_offense(<<-RUBY) + if RUBY_VERSION < 2.3 + describe 'skips checks under old ruby' do + end + else + describe 'first check' do + end + ^^^ Add an empty line after `describe`. + describe 'second check' do + end + end + RUBY + end + + bad_example = <<-RUBY + RSpec.describe Foo do + describe '#bar' do + end + describe '#baz' do + end + end + RUBY + + good_example = <<-RUBY + RSpec.describe Foo do + describe '#bar' do + end + + describe '#baz' do + end + end + RUBY + + include_examples 'autocorrect', + bad_example, + good_example +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/empty_line_after_final_let_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/empty_line_after_final_let_spec.rb new file mode 100644 index 0000000000..a8f6f7af47 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/empty_line_after_final_let_spec.rb @@ -0,0 +1,231 @@ +# frozen_string_literal: true + +RSpec.describe RuboCop::Cop::RSpec::EmptyLineAfterFinalLet do + subject(:cop) { described_class.new } + + it 'checks for empty line after last let' do + expect_offense(<<-RUBY) + RSpec.describe User do + let(:a) { a } + let(:b) { b } + ^^^^^^^^^^^^^ Add an empty line after the last `let` block. + it { expect(a).to eq(b) } + end + RUBY + end + + it 'check for empty line after the last `let!`' do + expect_offense(<<-RUBY) + RSpec.describe User do + let(:a) { a } + let!(:b) do + b + end + ^^^ Add an empty line after the last `let` block. + it { expect(a).to eq(b) } + end + RUBY + end + + it 'approves empty line after let' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + let(:a) { a } + let(:b) { b } + + it { expect(a).to eq(b) } + end + RUBY + end + + it 'allows comment followed by an empty line after let' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + let(:a) { a } + let(:b) { b } + # end of setup + + it { expect(a).to eq(b) } + end + RUBY + end + + it 'flags missing empty line after the comment that comes after last let' do + expect_offense(<<-RUBY) + RSpec.describe User do + let(:a) { a } + let(:b) { b } + # end of setup + ^^^^^^^^^^^^^^ Add an empty line after the last `let` block. + it { expect(a).to eq(b) } + end + RUBY + end + + it 'ignores empty lines between the lets' do + expect_offense(<<-RUBY) + RSpec.describe User do + let(:a) { a } + + subject { described_class } + + let!(:b) { b } + ^^^^^^^^^^^^^^ Add an empty line after the last `let` block. + it { expect(a).to eq(b) } + end + RUBY + end + + it 'handles let in tests' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + # This shouldn't really ever happen in a sane codebase but I still + # want to avoid false positives + it "doesn't mind me calling a method called let in the test" do + let(foo) + subject { bar } + end + end + RUBY + end + + it 'handles multiline let block' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + let(:a) { a } + let(:b) do + b + end + + it { expect(a).to eq(b) } + end + RUBY + end + + it 'handles let being the latest node' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + let(:a) { a } + let(:b) { b } + end + RUBY + end + + it 'handles HEREDOC for let' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + let(:foo) do + <<-BAR + hello + world + BAR + end + + it 'uses heredoc' do + expect(foo).to eql(" hello\n world\n") + end + end + RUBY + end + + it 'handles silly HEREDOC syntax for let' do + expect_no_offenses(<<-RUBY) + RSpec.describe 'silly heredoc syntax' do + let(:foo) { <<-BAR } + hello + world + BAR + + it 'has tricky syntax' do + expect(foo).to eql(" hello\n world\n") + end + end + RUBY + end + + it 'handles silly HEREDOC offense' do + expect_offense(<<-RUBY) + RSpec.describe 'silly heredoc syntax' do + let(:foo) { <<-BAR } + hello + world + BAR + ^^^ Add an empty line after the last `let` block. + it 'has tricky syntax' do + expect(foo).to eql(" hello\n world\n") + end + end + RUBY + end + + bad_example = <<-RUBY + RSpec.describe User do + let(:params) { foo } + it 'has a new line' do + end + end + RUBY + + good_example = <<-RUBY + RSpec.describe User do + let(:params) { foo } + + it 'has a new line' do + end + end + RUBY + + include_examples 'autocorrect', + bad_example, + good_example + + bad_example = <<-RUBY + RSpec.describe User do + let(:params) { foo } + # a multiline comment marking + # the end of setup + it 'has a new line' do + end + end + RUBY + + good_example = <<-RUBY + RSpec.describe User do + let(:params) { foo } + # a multiline comment marking + # the end of setup + + it 'has a new line' do + end + end + RUBY + + include_examples 'autocorrect', + bad_example, + good_example + + bad_example = <<-RUBY + RSpec.describe User do + let(:params) { <<-DOC } + I'm super annoying! + DOC + it 'has a new line' do + end + end + RUBY + + good_example = <<-RUBY + RSpec.describe User do + let(:params) { <<-DOC } + I'm super annoying! + DOC + + it 'has a new line' do + end + end + RUBY + + include_examples 'autocorrect', + bad_example, + good_example +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/empty_line_after_hook_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/empty_line_after_hook_spec.rb new file mode 100644 index 0000000000..4b73a9f99f --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/empty_line_after_hook_spec.rb @@ -0,0 +1,128 @@ +# frozen_string_literal: true + +RSpec.describe RuboCop::Cop::RSpec::EmptyLineAfterHook do + subject(:cop) { described_class.new } + + it 'checks for empty line after `before` hook' do + expect_offense(<<-RUBY) + RSpec.describe User do + before { do_something } + ^^^^^^^^^^^^^^^^^^^^^^^ Add an empty line after `before`. + it { does_something } + end + RUBY + end + + it 'checks for empty line after `after` hook' do + expect_offense(<<-RUBY) + RSpec.describe User do + after { do_something } + ^^^^^^^^^^^^^^^^^^^^^^ Add an empty line after `after`. + it { does_something } + end + RUBY + end + + it 'checks for empty line after `around` hook' do + expect_offense(<<-RUBY) + RSpec.describe User do + around { |test| test.run } + ^^^^^^^^^^^^^^^^^^^^^^^^^^ Add an empty line after `around`. + it { does_something } + end + RUBY + end + + it 'approves empty line after `before` hook' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + before { do_something } + + it { does_something } + end + RUBY + end + + it 'approves empty line after `after` hook' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + after { do_something } + + it { does_something } + end + RUBY + end + + it 'approves empty line after `around` hook' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + around { |test| test.run } + + it { does_something } + end + RUBY + end + + it 'handles multiline `before` block' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + before do + do_something + end + + it { does_something } + end + RUBY + end + + it 'handles multiline `after` block' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + after do + do_something + end + + it { does_something } + end + RUBY + end + + it 'handles multiline `around` block' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + around do |test| + test.run + end + + it { does_something } + end + RUBY + end + + it 'handles `before` being the latest node' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + before { do_something } + end + RUBY + end + + bad_example = <<-RUBY + RSpec.describe User do + before { do_something } + it { does_something } + end + RUBY + + good_example = <<-RUBY + RSpec.describe User do + before { do_something } + + it { does_something } + end + RUBY + + include_examples 'autocorrect', + bad_example, + good_example +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/empty_line_after_subject_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/empty_line_after_subject_spec.rb new file mode 100644 index 0000000000..166d0b5391 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/empty_line_after_subject_spec.rb @@ -0,0 +1,97 @@ +# frozen_string_literal: true + +RSpec.describe RuboCop::Cop::RSpec::EmptyLineAfterSubject do + subject(:cop) { described_class.new } + + it 'checks for empty line after subject' do + expect_offense(<<-RUBY) + RSpec.describe User do + subject { described_class.new } + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Add empty line after `subject`. + let(:params) { foo } + end + RUBY + end + + it 'checks for empty line after subject!' do + expect_offense(<<-RUBY) + RSpec.describe User do + subject! { described_class.new } + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Add empty line after `subject`. + let(:params) { foo } + end + RUBY + end + + it 'approves empty line after subject' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + subject { described_class.new } + + let(:params) { foo } + end + RUBY + end + + it 'approves empty line after subject!' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + subject! { described_class.new } + + let(:params) { foo } + end + RUBY + end + + it 'handles subjects in tests' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + # This shouldn't really ever happen in a sane codebase but I still + # want to avoid false positives + it "doesn't mind me calling a method called subject in the test" do + subject { bar } + let(foo) + end + end + RUBY + end + + it 'handles multiline subject block' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + subject do + described_class.new + end + + let(:params) { foo } + end + RUBY + end + + it 'handles subject being the latest node' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + subject { described_user } + end + RUBY + end + + bad_example = <<-RUBY + RSpec.describe User do + subject { described_class.new } + let(:params) { foo } + end + RUBY + + good_example = <<-RUBY + RSpec.describe User do + subject { described_class.new } + + let(:params) { foo } + end + RUBY + + include_examples 'autocorrect', + bad_example, + good_example +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/example_length_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/example_length_spec.rb new file mode 100644 index 0000000000..ead28b62d2 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/example_length_spec.rb @@ -0,0 +1,76 @@ +RSpec.describe RuboCop::Cop::RSpec::ExampleLength, :config do + subject(:cop) { described_class.new(config) } + + let(:cop_config) { { 'Max' => 3 } } + + it 'ignores non-spec blocks' do + expect_no_offenses(<<-RUBY) + foo do + line 1 + line 2 + line 3 + line 4 + end + RUBY + end + + it 'allows an empty example' do + expect_no_offenses(<<-RUBY) + it do + end + RUBY + end + + it 'allows a short example' do + expect_no_offenses(<<-RUBY) + it do + line 1 + line 2 + line 3 + end + RUBY + end + + it 'ignores comments' do + expect_no_offenses(<<-RUBY) + it do + line 1 + line 2 + # comment + line 3 + end + RUBY + end + + context 'when inspecting large examples' do + it 'flags the example' do + expect_offense(<<-RUBY) + it do + ^^^^^ Example has too many lines [4/3]. + line 1 + line 2 + line 3 + line 4 + end + RUBY + end + end + + context 'with CountComments enabled' do + let(:cop_config) do + { 'Max' => 3, 'CountComments' => true } + end + + it 'flags the example' do + expect_offense(<<-RUBY) + it do + ^^^^^ Example has too many lines [4/3]. + line 1 + line 2 + # comment + line 3 + end + RUBY + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/example_without_description_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/example_without_description_spec.rb new file mode 100644 index 0000000000..546a936288 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/example_without_description_spec.rb @@ -0,0 +1,90 @@ +RSpec.describe RuboCop::Cop::RSpec::ExampleWithoutDescription, :config do + subject(:cop) { described_class.new(config) } + + let(:cop_config) do + { 'EnforcedStyle' => enforced_style } + end + + context 'with EnforcedStyle `always_allow`' do + let(:enforced_style) { 'always_allow' } + + it 'flags empty strings for description' do + expect_offense(<<-RUBY) + it '' do + ^^ Omit the argument when you want to have auto-generated description. + expect(subject).to be_good + end + RUBY + end + + it 'ignores `it` with a description' do + expect_no_offenses(<<-RUBY) + it 'is good' do + expect(subject).to be_good + end + RUBY + end + + it 'ignores `it` without an argument' do + expect_no_offenses(<<-RUBY) + it do + expect(subject).to be_good + end + RUBY + end + end + + context 'with EnforcedStyle `single_line_only`' do + let(:enforced_style) { 'single_line_only' } + + it 'flags missing description in multi-line examples' do + expect_offense(<<-RUBY) + it do + ^^ Add a description. + expect(subject).to be_good + end + RUBY + end + + it 'ignores missing description in single-line examples' do + expect_no_offenses(<<-RUBY) + it { expect(subject).to be_good } + RUBY + end + + it 'flags example with an empty string for description' do + expect_offense(<<-RUBY) + it('') { expect(subject).to be_good } + ^^ Omit the argument when you want to have auto-generated description. + RUBY + end + end + + context 'with EnforcedStyle `disallow`' do + let(:enforced_style) { 'disallow' } + + it 'flags missing description in multi-line examples' do + expect_offense(<<-RUBY) + it do + ^^ Add a description. + expect(subject).to be_good + end + RUBY + end + + it 'flags missing description in single-line examples' do + expect_offense(<<-RUBY) + it { expect(subject).to be_good } + ^^ Add a description. + RUBY + end + + it 'ignores `it` with a description' do + expect_no_offenses(<<-RUBY) + it 'is good' do + expect(subject).to be_good + end + RUBY + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/example_wording_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/example_wording_spec.rb new file mode 100644 index 0000000000..9b64be3ceb --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/example_wording_spec.rb @@ -0,0 +1,119 @@ +RSpec.describe RuboCop::Cop::RSpec::ExampleWording, :config do + subject(:cop) { described_class.new(config) } + + context 'with configuration' do + let(:cop_config) do + { + 'CustomTransform' => { 'have' => 'has' }, + 'IgnoredWords' => %w[only really] + } + end + + it 'ignores non-example blocks' do + expect_no_offenses('foo "should do something" do; end') + end + + it 'finds description with `should` at the beginning' do + expect_offense(<<-RUBY) + it 'should do something' do + ^^^^^^^^^^^^^^^^^^^ Do not use should when describing your tests. + end + RUBY + end + + it 'finds description with `Should` at the beginning' do + expect_offense(<<-RUBY) + it 'Should do something' do + ^^^^^^^^^^^^^^^^^^^ Do not use should when describing your tests. + end + RUBY + end + + it 'finds description with `shouldn\'t` at the beginning' do + expect_offense(<<-RUBY) + it "shouldn't do something" do + ^^^^^^^^^^^^^^^^^^^^^^ Do not use should when describing your tests. + end + RUBY + end + + it 'flags a lone should' do + expect_offense(<<-RUBY) + it 'should' do + ^^^^^^ Do not use should when describing your tests. + end + RUBY + end + + it 'flags a lone should not' do + expect_offense(<<-RUBY) + it 'should not' do + ^^^^^^^^^^ Do not use should when describing your tests. + end + RUBY + end + + it 'finds leading its' do + expect_offense(<<-RUBY) + it "it does something" do + ^^^^^^^^^^^^^^^^^ Do not repeat 'it' when describing your tests. + end + RUBY + end + + it "skips words beginning with 'it'" do + expect_no_offenses(<<-RUBY) + it 'itemizes items' do + end + RUBY + end + + it 'skips descriptions without `should` at the beginning' do + expect_no_offenses(<<-RUBY) + it 'finds no should here' do + end + RUBY + end + + it 'skips descriptions starting with words that begin with `should`' do + expect_no_offenses(<<-RUBY) + it 'shoulders the burden' do + end + RUBY + end + + include_examples 'autocorrect', + 'it "should only have trait" do end', + 'it "only has trait" do end' + + include_examples 'autocorrect', + 'it "SHOULDN\'T only have trait" do end', + 'it "DOES NOT only have trait" do end' + + include_examples 'autocorrect', + 'it "it does something" do end', + 'it "does something" do end' + + include_examples 'autocorrect', + 'it "It does something" do end', + 'it "does something" do end' + + include_examples 'autocorrect', + 'it "should" do end', + 'it "" do end' + + include_examples 'autocorrect', + 'it "should not" do end', + 'it "does not" do end' + end + + context 'when configuration is empty' do + include_examples 'autocorrect', + 'it "should have trait" do end', + 'it "haves trait" do end' + + include_examples 'autocorrect', + 'it "should only fail" do end', + 'it "onlies fail" do end' + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/expect_actual_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/expect_actual_spec.rb new file mode 100644 index 0000000000..503fe8fff4 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/expect_actual_spec.rb @@ -0,0 +1,150 @@ +# frozen_string_literal: true + +RSpec.describe RuboCop::Cop::RSpec::ExpectActual, :config do + subject(:cop) { described_class.new(config) } + + it 'flags numeric literal values within expect(...)' do + expect_offense(<<-RUBY) + describe Foo do + it 'uses expect incorrectly' do + expect(123).to eq(bar) + ^^^ Provide the actual you are testing to `expect(...)`. + expect(12.3).to eq(bar) + ^^^^ Provide the actual you are testing to `expect(...)`. + expect(1i).to eq(bar) + ^^ Provide the actual you are testing to `expect(...)`. + expect(1r).to eq(bar) + ^^ Provide the actual you are testing to `expect(...)`. + end + end + RUBY + end + + it 'flags boolean literal values within expect(...)' do + expect_offense(<<-RUBY) + describe Foo do + it 'uses expect incorrectly' do + expect(true).to eq(bar) + ^^^^ Provide the actual you are testing to `expect(...)`. + expect(false).to eq(bar) + ^^^^^ Provide the actual you are testing to `expect(...)`. + end + end + RUBY + end + + it 'flags string and symbol literal values within expect(...)' do + expect_offense(<<-RUBY) + describe Foo do + it 'uses expect incorrectly' do + expect("foo").to eq(bar) + ^^^^^ Provide the actual you are testing to `expect(...)`. + expect(:foo).to eq(bar) + ^^^^ Provide the actual you are testing to `expect(...)`. + end + end + RUBY + end + + it 'flags literal nil value within expect(...)' do + expect_offense(<<-RUBY) + describe Foo do + it 'uses expect incorrectly' do + expect(nil).to eq(bar) + ^^^ Provide the actual you are testing to `expect(...)`. + end + end + RUBY + end + + it 'does not flag dynamic values within expect(...)' do + expect_no_offenses(<<-'RUBY') + describe Foo do + it 'uses expect correctly' do + expect(foo).to eq(bar) + expect("foo#{baz}").to eq(bar) + expect(:"foo#{baz}").to eq(bar) + end + end + RUBY + end + + it 'flags arrays containing only literal values within expect(...)' do + expect_offense(<<-RUBY) + describe Foo do + it 'uses expect incorrectly' do + expect([123]).to eq(bar) + ^^^^^ Provide the actual you are testing to `expect(...)`. + expect([[123]]).to eq(bar) + ^^^^^^^ Provide the actual you are testing to `expect(...)`. + end + end + RUBY + end + + it 'flags hashes containing only literal values within expect(...)' do + expect_offense(<<-RUBY) + describe Foo do + it 'uses expect incorrectly' do + expect(foo: 1, bar: 2).to eq(bar) + ^^^^^^^^^^^^^^ Provide the actual you are testing to `expect(...)`. + expect(foo: 1, bar: [{}]).to eq(bar) + ^^^^^^^^^^^^^^^^^ Provide the actual you are testing to `expect(...)`. + end + end + RUBY + end + + it 'flags ranges containing only literal values within expect(...)' do + expect_offense(<<-RUBY) + describe Foo do + it 'uses expect incorrectly' do + expect(1..2).to eq(bar) + ^^^^ Provide the actual you are testing to `expect(...)`. + expect(1...2).to eq(bar) + ^^^^^ Provide the actual you are testing to `expect(...)`. + end + end + RUBY + end + + it 'flags regexps containing only literal values within expect(...)' do + expect_offense(<<-RUBY) + describe Foo do + it 'uses expect incorrectly' do + expect(/foo|bar/).to eq(bar) + ^^^^^^^^^ Provide the actual you are testing to `expect(...)`. + end + end + RUBY + end + + it 'does not flag complex values with dynamic parts within expect(...)' do + expect_no_offenses(<<-'RUBY') + describe Foo do + it 'uses expect incorrectly' do + expect.to eq(bar) + expect([foo]).to eq(bar) + expect([[foo]]).to eq(bar) + expect(foo: 1, bar: foo).to eq(bar) + expect(1..foo).to eq(bar) + expect(1...foo).to eq(bar) + expect(/foo|#{bar}/).to eq(bar) + end + end + RUBY + end + + context 'when inspecting rspec-rails routing specs' do + let(:cop_config) { {} } + + it 'ignores rspec-rails routing specs' do + inspect_source( + 'expect(get: "/foo").to be_routeable', + 'spec/routing/foo_spec.rb' + ) + + expect(cop.offenses).to be_empty + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/expect_change_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/expect_change_spec.rb new file mode 100644 index 0000000000..20b56701f8 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/expect_change_spec.rb @@ -0,0 +1,78 @@ +RSpec.describe RuboCop::Cop::RSpec::ExpectChange, :config do + subject(:cop) { described_class.new(config) } + + let(:cop_config) do + { 'EnforcedStyle' => enforced_style } + end + + context 'with EnforcedStyle `method_call`' do + let(:enforced_style) { 'method_call' } + + it 'finds blocks that contain simple message sending' do + expect_offense(<<-RUBY) + it do + expect(run).to change { User.count } + ^^^^^^^^^^^^^^^^^^^^^ Prefer `change(User, :count)`. + end + RUBY + end + + it 'ignores blocks that cannot be converted to obj/attribute pair' do + expect_no_offenses(<<-RUBY) + it do + expect(run).to change { User.sum(:points) } + end + RUBY + end + + it 'ignores change method of object that happens to receive a block' do + expect_no_offenses(<<-RUBY) + it do + Record.change { User.count } + end + RUBY + end + + include_examples( + 'autocorrect', + 'expect(run).to change { User.count }.by(1)', + 'expect(run).to change(User, :count).by(1)' + ) + end + + context 'with EnforcedStyle `block`' do + let(:enforced_style) { 'block' } + + it 'finds change matcher without block' do + expect_offense(<<-RUBY) + it do + expect(run).to change(User, :count) + ^^^^^^^^^^^^^^^^^^^^ Prefer `change { User.count }`. + end + RUBY + end + + it 'finds change matcher when receiver is a variable' do + expect_offense(<<-RUBY) + it do + expect(run).to change(user, :count) + ^^^^^^^^^^^^^^^^^^^^ Prefer `change { user.count }`. + end + RUBY + end + + it 'ignores methods called change' do + expect_no_offenses(<<-RUBY) + it do + record.change(user, :count) + end + RUBY + end + + include_examples( + 'autocorrect', + 'expect(run).to change(User, :count).by(1)', + 'expect(run).to change { User.count }.by(1)' + ) + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/expect_in_hook_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/expect_in_hook_spec.rb new file mode 100644 index 0000000000..47593c54a2 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/expect_in_hook_spec.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +RSpec.describe RuboCop::Cop::RSpec::ExpectInHook do + subject(:cop) { described_class.new } + + it 'adds an offense for `expect` in `before` hook' do + expect_offense(<<-RUBY) + before do + expect(something).to eq('foo') + ^^^^^^ Do not use `expect` in `before` hook + is_expected.to eq('foo') + ^^^^^^^^^^^ Do not use `is_expected` in `before` hook + expect_any_instance_of(Something).to receive(:foo) + ^^^^^^^^^^^^^^^^^^^^^^ Do not use `expect_any_instance_of` in `before` hook + end + RUBY + end + + it 'adds an offense for `expect` in `after` hook' do + expect_offense(<<-RUBY) + after do + expect(something).to eq('foo') + ^^^^^^ Do not use `expect` in `after` hook + is_expected.to eq('foo') + ^^^^^^^^^^^ Do not use `is_expected` in `after` hook + expect_any_instance_of(Something).to receive(:foo) + ^^^^^^^^^^^^^^^^^^^^^^ Do not use `expect_any_instance_of` in `after` hook + end + RUBY + end + + it 'adds an offense for `expect` in `around` hook' do + expect_offense(<<-RUBY) + around do + expect(something).to eq('foo') + ^^^^^^ Do not use `expect` in `around` hook + is_expected(something).to eq('foo') + ^^^^^^^^^^^ Do not use `is_expected` in `around` hook + expect_any_instance_of(Something).to receive(:foo) + ^^^^^^^^^^^^^^^^^^^^^^ Do not use `expect_any_instance_of` in `around` hook + end + RUBY + end + + it 'adds an offense for `expect` with block in `before` hook' do + expect_offense(<<-RUBY) + before do + expect { something }.to eq('foo') + ^^^^^^ Do not use `expect` in `before` hook + end + RUBY + end + + it 'accepts an empty `before` hook' do + expect_no_offenses(<<-RUBY) + before do + end + RUBY + end + + it 'accepts `allow` in `before` hook' do + expect_no_offenses(<<-RUBY) + before do + allow(something).to receive(:foo) + allow_any_instance_of(something).to receive(:foo) + end + RUBY + end + + it 'accepts `expect` in `it`' do + expect_no_offenses(<<-RUBY) + it do + expect(something).to eq('foo') + is_expected.to eq('foo') + expect_any_instance_of(something).to receive(:foo) + end + RUBY + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/expect_output_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/expect_output_spec.rb new file mode 100644 index 0000000000..20308e028e --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/expect_output_spec.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe RuboCop::Cop::RSpec::ExpectOutput do + subject(:cop) { described_class.new } + + it 'registers an offense for overwriting $stdout within an example' do + expect_offense(<<-RUBY) + specify do + $stdout = StringIO.new + ^^^^^^^ Use `expect { ... }.to output(...).to_stdout` instead of mutating $stdout. + end + RUBY + end + + it 'registers an offense for overwriting $stderr ' \ + 'within an example scoped hook' do + expect_offense(<<-RUBY) + before(:each) do + $stderr = StringIO.new + ^^^^^^^ Use `expect { ... }.to output(...).to_stderr` instead of mutating $stderr. + end + RUBY + end + + it 'does not register an offense for interacting with $stdout' do + expect_no_offenses(<<-RUBY) + specify do + $stdout.puts("hi") + end + RUBY + end + + it 'does not flag assignments to other global variables' do + expect_no_offenses(<<-RUBY) + specify do + $blah = StringIO.new + end + RUBY + end + + it 'does not flag assignments to $stdout outside of example scope' do + expect_no_offenses(<<-RUBY) + before(:suite) do + $stderr = StringIO.new + end + RUBY + end + + it 'does not flag assignments to $stdout in example_group scope' do + expect_no_offenses(<<-RUBY) + describe Foo do + $stderr = StringIO.new + end + RUBY + end + + it 'does not flag assigns to $stdout when in the root scope' do + expect_no_offenses('$stderr = StringIO.new') + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/factory_bot/attribute_defined_statically_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/factory_bot/attribute_defined_statically_spec.rb new file mode 100644 index 0000000000..1a53d1b88b --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/factory_bot/attribute_defined_statically_spec.rb @@ -0,0 +1,172 @@ +# frozen_string_literal: true + +RSpec.describe RuboCop::Cop::RSpec::FactoryBot::AttributeDefinedStatically do # rubocop:disable Metrics/LineLength + subject(:cop) { described_class.new } + + it 'registers an offense for offending code' do + expect_offense(<<-RUBY) + FactoryBot.define do + factory :post do + title "Something" + ^^^^^^^^^^^^^^^^^ Use a block to declare attribute values. + published_at 1.day.from_now + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use a block to declare attribute values. + status [:draft, :published].sample + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use a block to declare attribute values. + created_at 1.day.ago + ^^^^^^^^^^^^^^^^^^^^ Use a block to declare attribute values. + update_times [Time.current] + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use a block to declare attribute values. + meta_tags(foo: Time.current) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use a block to declare attribute values. + end + end + RUBY + end + + it 'registers an offense in a trait' do + expect_offense(<<-RUBY) + FactoryBot.define do + factory :post do + trait :published do + title "Something" + ^^^^^^^^^^^^^^^^^ Use a block to declare attribute values. + published_at 1.day.from_now + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use a block to declare attribute values. + end + end + end + RUBY + end + + it 'registers an offense in a transient block' do + expect_offense(<<-RUBY) + FactoryBot.define do + factory :post do + transient do + title "Something" + ^^^^^^^^^^^^^^^^^ Use a block to declare attribute values. + published_at 1.day.from_now + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use a block to declare attribute values. + end + end + end + RUBY + end + + it 'registers an offense for an attribute defined on `self`' do + expect_offense(<<-RUBY) + FactoryBot.define do + factory :post do + self.start { Date.today } + self.end Date.tomorrow + ^^^^^^^^^^^^^^^^^^^^^^ Use a block to declare attribute values. + end + end + RUBY + end + + it 'accepts valid factory definitions' do + expect_no_offenses(<<-RUBY) + FactoryBot.define do + factory :post do + trait :published do + published_at { 1.day.from_now } + end + created_at { 1.day.ago } + status { :draft } + comments_count { 0 } + title { "Static" } + description { FFaker::Lorem.paragraph(10) } + recent_statuses { [] } + tags { { like_count: 2 } } + + before(:create, &:initialize_something) + after(:create, &:rebuild_cache) + end + end + RUBY + end + + it 'does not add offense if out of factory bot block' do + expect_no_offenses(<<-RUBY) + status [:draft, :published].sample + published_at 1.day.from_now + created_at 1.day.ago + update_times [Time.current] + meta_tags(foo: Time.current) + RUBY + end + + it 'accepts valid association definitions' do + expect_no_offenses(<<-RUBY) + FactoryBot.define do + factory :post do + author age: 42, factory: :user + end + end + RUBY + end + + it 'accepts valid sequence definition' do + expect_no_offenses(<<-RUBY) + FactoryBot.define do + factory :post do + sequence :negative_numbers, &:-@ + end + end + RUBY + end + + bad = <<-RUBY + FactoryBot.define do + factory :post do + title "Something" + comments_count 0 + tag Tag::MAGIC + recent_statuses [] + status([:draft, :published].sample) + published_at 1.day.from_now + created_at(1.day.ago) + updated_at Time.current + update_times [Time.current] + meta_tags(foo: Time.current) + other_tags({ foo: Time.current }) + options color: :blue + other_options Tag::MAGIC => :magic + self.end Date.tomorrow + + trait :old do + published_at 1.week.ago + end + end + end + RUBY + + corrected = <<-RUBY + FactoryBot.define do + factory :post do + title { "Something" } + comments_count { 0 } + tag { Tag::MAGIC } + recent_statuses { [] } + status { [:draft, :published].sample } + published_at { 1.day.from_now } + created_at { 1.day.ago } + updated_at { Time.current } + update_times { [Time.current] } + meta_tags { { foo: Time.current } } + other_tags { { foo: Time.current } } + options { { color: :blue } } + other_options { { Tag::MAGIC => :magic } } + self.end { Date.tomorrow } + + trait :old do + published_at { 1.week.ago } + end + end + end + RUBY + + include_examples 'autocorrect', bad, corrected +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/factory_bot/create_list_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/factory_bot/create_list_spec.rb new file mode 100644 index 0000000000..875243a75f --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/factory_bot/create_list_spec.rb @@ -0,0 +1,139 @@ +RSpec.describe RuboCop::Cop::RSpec::FactoryBot::CreateList, :config do + subject(:cop) { described_class.new(config) } + + let(:cop_config) do + { 'EnforcedStyle' => enforced_style } + end + + context 'when EnforcedStyle is :create_list' do + let(:enforced_style) { :create_list } + + it 'flags usage of n.times with no arguments' do + expect_offense(<<-RUBY) + 3.times { create :user } + ^^^^^^^ Prefer create_list. + RUBY + end + + it 'flags usage of n.times when FactoryGirl.create is used' do + expect_offense(<<-RUBY) + 3.times { FactoryGirl.create :user } + ^^^^^^^ Prefer create_list. + RUBY + end + + it 'flags usage of n.times when FactoryBot.create is used' do + expect_offense(<<-RUBY) + 3.times { FactoryBot.create :user } + ^^^^^^^ Prefer create_list. + RUBY + end + + it 'ignores create method of other object' do + expect_no_offenses(<<-RUBY) + 3.times { SomeFactory.create :user } + RUBY + end + + it 'ignores create in other block' do + expect_no_offenses(<<-RUBY) + allow(User).to receive(:create) { create :user } + RUBY + end + + it 'ignores n.times with argument' do + expect_no_offenses(<<-RUBY) + 3.times { |n| create :user, created_at: n.days.ago } + RUBY + end + + it 'ignores n.times when there is no create call inside' do + expect_no_offenses(<<-RUBY) + 3.times { do_something } + RUBY + end + + it 'ignores n.times when there is other calls but create' do + expect_no_offenses(<<-RUBY) + used_passwords = [] + 3.times do + u = create :user + expect(used_passwords).not_to include(u.password) + used_passwords << u.password + end + RUBY + end + + it 'flags FactoryGirl.create calls with a block' do + expect_offense(<<-RUBY) + 3.times do + ^^^^^^^ Prefer create_list. + create(:user) { |user| create :account, user: user } + end + RUBY + end + + include_examples 'autocorrect', + '5.times { create :user }', + 'create_list :user, 5' + + include_examples 'autocorrect', + '5.times { create(:user, :trait) }', + 'create_list(:user, 5, :trait)' + + include_examples 'autocorrect', + '5.times { create :user, :trait, key: val }', + 'create_list :user, 5, :trait, key: val' + + include_examples 'autocorrect', + '5.times { FactoryGirl.create :user }', + 'FactoryGirl.create_list :user, 5' + end + + context 'when EnforcedStyle is :n_times' do + let(:enforced_style) { :n_times } + + it 'flags usage of create_list' do + expect_offense(<<-RUBY) + create_list :user, 3 + ^^^^^^^^^^^ Prefer 3.times. + RUBY + end + + it 'flags usage of FactoryGirl.create_list' do + expect_offense(<<-RUBY) + FactoryGirl.create_list :user, 3 + ^^^^^^^^^^^ Prefer 3.times. + RUBY + end + + it 'flags usage of FactoryGirl.create_list with a block' do + expect_offense(<<-RUBY) + FactoryGirl.create_list(:user, 3) { |user| user.points = rand(1000) } + ^^^^^^^^^^^ Prefer 3.times. + RUBY + end + + it 'ignores create method of other object' do + expect_no_offenses(<<-RUBY) + SomeFactory.create_list :user, 3 + RUBY + end + + include_examples 'autocorrect', + 'create_list :user, 5', + '5.times { create :user }' + + include_examples 'autocorrect', + 'create_list(:user, 5, :trait)', + '5.times { create(:user, :trait) }' + + include_examples 'autocorrect', + 'create_list :user, 5, :trait, key: val', + '5.times { create :user, :trait, key: val }' + + include_examples 'autocorrect', + 'FactoryGirl.create_list :user, 5', + '5.times { FactoryGirl.create :user }' + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/file_path_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/file_path_spec.rb new file mode 100644 index 0000000000..7cc99796f9 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/file_path_spec.rb @@ -0,0 +1,198 @@ +RSpec.describe RuboCop::Cop::RSpec::FilePath, :config do + subject(:cop) { described_class.new(config) } + + it 'registers an offense for a bad path' do + expect_offense(<<-RUBY, 'wrong_path_foo_spec.rb') + describe MyClass, 'foo' do; end + ^^^^^^^^^^^^^^^^^^^^^^^ Spec path should end with `my_class*foo*_spec.rb`. + RUBY + end + + it 'registers an offense for a wrong class but a correct method' do + expect_offense(<<-RUBY, 'wrong_class_foo_spec.rb') + describe MyClass, '#foo' do; end + ^^^^^^^^^^^^^^^^^^^^^^^^ Spec path should end with `my_class*foo*_spec.rb`. + RUBY + end + + it 'registers an offense for a repeated .rb' do + expect_offense(<<-RUBY, 'my_class/foo_spec.rb.rb') + describe MyClass, '#foo' do; end + ^^^^^^^^^^^^^^^^^^^^^^^^ Spec path should end with `my_class*foo*_spec.rb`. + RUBY + end + + it 'registers an offense for a file missing a .rb' do + expect_offense(<<-RUBY, 'my_class/foo_specorb') + describe MyClass, '#foo' do; end + ^^^^^^^^^^^^^^^^^^^^^^^^ Spec path should end with `my_class*foo*_spec.rb`. + RUBY + end + + it 'registers an offense for a wrong class and highlights metadata' do + expect_offense(<<-RUBY, 'wrong_class_foo_spec.rb') + describe MyClass, '#foo', blah: :blah do; end + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Spec path should end with `my_class*foo*_spec.rb`. + RUBY + end + + it 'registers an offense for a wrong class name' do + expect_offense(<<-RUBY, 'wrong_class_spec.rb') + describe MyClass do; end + ^^^^^^^^^^^^^^^^ Spec path should end with `my_class*_spec.rb`. + RUBY + end + + it 'registers an offense for a wrong class name with a symbol argument' do + expect_offense(<<-RUBY, 'wrong_class_spec.rb') + describe MyClass, :foo do; end + ^^^^^^^^^^^^^^^^^^^^^^ Spec path should end with `my_class*_spec.rb`. + RUBY + end + + it 'registers an offense for a file missing _spec' do + expect_offense(<<-RUBY, 'user.rb') + describe User do; end + ^^^^^^^^^^^^^ Spec path should end with `user*_spec.rb`. + RUBY + end + + it 'skips specs that do not describe a class / method' do + expect_no_offenses(<<-RUBY, 'some/class/spec.rb') + describe 'Test something' do; end + RUBY + end + + it 'skips specs that do have multiple top level describes' do + expect_no_offenses(<<-RUBY, 'some/class/spec.rb') + describe MyClass, 'do_this' do; end + describe MyClass, 'do_that' do; end + RUBY + end + + it 'checks class specs' do + expect_no_offenses(<<-RUBY, 'some/class_spec.rb') + describe Some::Class do; end + RUBY + end + + it 'allows different parent directories' do + expect_no_offenses(<<-RUBY, 'parent_dir/some/class_spec.rb') + describe Some::Class do; end + RUBY + end + + it 'handles CamelCaps class names' do + expect_no_offenses(<<-RUBY, 'my_class_spec.rb') + describe MyClass do; end + RUBY + end + + it 'handles ACRONYMClassNames' do + expect_no_offenses(<<-RUBY, 'abc_one/two_spec.rb') + describe ABCOne::Two do; end + RUBY + end + + it 'handles ALLCAPS class names' do + expect_no_offenses(<<-RUBY, 'allcaps_spec.rb') + describe ALLCAPS do; end + RUBY + end + + it 'handles alphanumeric class names' do + expect_no_offenses(<<-RUBY, 'ipv4_and_ipv6_spec.rb') + describe IPV4AndIPV6 do; end + RUBY + end + + it 'checks instance methods' do + expect_no_offenses(<<-RUBY, 'some/class/inst_spec.rb') + describe Some::Class, '#inst' do; end + RUBY + end + + it 'checks class methods' do + expect_no_offenses(<<-RUBY, 'some/class/inst_spec.rb') + describe Some::Class, '.inst' do; end + RUBY + end + + it 'allows flat hierarchies for instance methods' do + expect_no_offenses(<<-RUBY, 'some/class_inst_spec.rb') + describe Some::Class, '#inst' do; end + RUBY + end + + it 'allows flat hierarchies for class methods' do + expect_no_offenses(<<-RUBY, 'some/class_inst_spec.rb') + describe Some::Class, '.inst' do; end + RUBY + end + + it 'allows subdirs for instance methods' do + filename = 'some/class/instance_methods/inst_spec.rb' + expect_no_offenses(<<-RUBY, filename) + describe Some::Class, '#inst' do; end + RUBY + end + + it 'allows subdirs for class methods' do + filename = 'some/class/class_methods/inst_spec.rb' + expect_no_offenses(<<-RUBY, filename) + describe Some::Class, '.inst' do; end + RUBY + end + + it 'ignores non-alphanumeric characters' do + expect_no_offenses(<<-RUBY, 'some/class/pred_spec.rb') + describe Some::Class, '#pred?' do; end + RUBY + end + + it 'allows bang method' do + expect_no_offenses(<<-RUBY, 'some/class/bang_spec.rb') + describe Some::Class, '#bang!' do; end + RUBY + end + + it 'allows flexibility with predicates' do + filename = 'some/class/thing_predicate_spec.rb' + expect_no_offenses(<<-RUBY, filename) + describe Some::Class, '#thing?' do; end + RUBY + end + + it 'allows flexibility with operators' do + filename = 'my_little_class/spaceship_operator_spec.rb' + expect_no_offenses(<<-RUBY, filename) + describe MyLittleClass, '#<=>' do; end + RUBY + end + + context 'when configured with CustomTransform' do + let(:cop_config) { { 'CustomTransform' => { 'FooFoo' => 'foofoo' } } } + + it 'respects custom module name transformation' do + expect_no_offenses(<<-RUBY, 'foofoo/some/class/bar_spec.rb') + describe FooFoo::Some::Class, '#bar' do; end + RUBY + end + + it 'ignores routing specs' do + expect_no_offenses(<<-RUBY, 'foofoo/some/class/bar_spec.rb') + describe MyController, "#foo", type: :routing do; end + RUBY + end + end + + context 'when configured with IgnoreMethods' do + let(:cop_config) { { 'IgnoreMethods' => true } } + + it 'does not care about the described method' do + expect_no_offenses(<<-RUBY, 'my_class_spec.rb') + describe MyClass, '#look_here_a_method' do; end + RUBY + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/focus_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/focus_spec.rb new file mode 100644 index 0000000000..fa9b950847 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/focus_spec.rb @@ -0,0 +1,131 @@ +RSpec.describe RuboCop::Cop::RSpec::Focus do + subject(:cop) { described_class.new } + + # rubocop:disable RSpec/ExampleLength + it 'flags all rspec example blocks with that include `focus: true`' do + expect_offense(<<-RUBY) + example 'test', meta: true, focus: true do; end + ^^^^^^^^^^^ Focused spec found. + xit 'test', meta: true, focus: true do; end + ^^^^^^^^^^^ Focused spec found. + describe 'test', meta: true, focus: true do; end + ^^^^^^^^^^^ Focused spec found. + it 'test', meta: true, focus: true do; end + ^^^^^^^^^^^ Focused spec found. + xspecify 'test', meta: true, focus: true do; end + ^^^^^^^^^^^ Focused spec found. + specify 'test', meta: true, focus: true do; end + ^^^^^^^^^^^ Focused spec found. + example_group 'test', meta: true, focus: true do; end + ^^^^^^^^^^^ Focused spec found. + scenario 'test', meta: true, focus: true do; end + ^^^^^^^^^^^ Focused spec found. + xexample 'test', meta: true, focus: true do; end + ^^^^^^^^^^^ Focused spec found. + xdescribe 'test', meta: true, focus: true do; end + ^^^^^^^^^^^ Focused spec found. + context 'test', meta: true, focus: true do; end + ^^^^^^^^^^^ Focused spec found. + xcontext 'test', meta: true, focus: true do; end + ^^^^^^^^^^^ Focused spec found. + feature 'test', meta: true, focus: true do; end + ^^^^^^^^^^^ Focused spec found. + xfeature 'test', meta: true, focus: true do; end + ^^^^^^^^^^^ Focused spec found. + xscenario 'test', meta: true, focus: true do; end + ^^^^^^^^^^^ Focused spec found. + RUBY + end + + it 'flags all rspec example blocks that include `:focus`' do + expect_offense(<<-RUBY) + example_group 'test', :focus do; end + ^^^^^^ Focused spec found. + feature 'test', :focus do; end + ^^^^^^ Focused spec found. + xexample 'test', :focus do; end + ^^^^^^ Focused spec found. + xdescribe 'test', :focus do; end + ^^^^^^ Focused spec found. + xscenario 'test', :focus do; end + ^^^^^^ Focused spec found. + specify 'test', :focus do; end + ^^^^^^ Focused spec found. + example 'test', :focus do; end + ^^^^^^ Focused spec found. + xfeature 'test', :focus do; end + ^^^^^^ Focused spec found. + xspecify 'test', :focus do; end + ^^^^^^ Focused spec found. + scenario 'test', :focus do; end + ^^^^^^ Focused spec found. + describe 'test', :focus do; end + ^^^^^^ Focused spec found. + xit 'test', :focus do; end + ^^^^^^ Focused spec found. + context 'test', :focus do; end + ^^^^^^ Focused spec found. + xcontext 'test', :focus do; end + ^^^^^^ Focused spec found. + it 'test', :focus do; end + ^^^^^^ Focused spec found. + RUBY + end + # rubocop:enable RSpec/ExampleLength + + it 'does not flag unfocused specs' do + expect_no_offenses(<<-RUBY) + xcontext 'test' do; end + xscenario 'test' do; end + xspecify 'test' do; end + describe 'test' do; end + example 'test' do; end + xexample 'test' do; end + scenario 'test' do; end + specify 'test' do; end + xit 'test' do; end + feature 'test' do; end + xfeature 'test' do; end + context 'test' do; end + it 'test' do; end + example_group 'test' do; end + xdescribe 'test' do; end + RUBY + end + + it 'does not flag a method that is focused twice' do + expect_offense(<<-RUBY) + fit "foo", :focus do + ^^^^^^^^^^^^^^^^^ Focused spec found. + end + RUBY + end + + it 'ignores non-rspec code with :focus blocks' do + expect_no_offenses(<<-RUBY) + some_method "foo", focus: true do + end + RUBY + end + + it 'flags focused block types' do + expect_offense(<<-RUBY) + fdescribe 'test' do; end + ^^^^^^^^^^^^^^^^ Focused spec found. + ffeature 'test' do; end + ^^^^^^^^^^^^^^^ Focused spec found. + fcontext 'test' do; end + ^^^^^^^^^^^^^^^ Focused spec found. + fit 'test' do; end + ^^^^^^^^^^ Focused spec found. + fscenario 'test' do; end + ^^^^^^^^^^^^^^^^ Focused spec found. + fexample 'test' do; end + ^^^^^^^^^^^^^^^ Focused spec found. + fspecify 'test' do; end + ^^^^^^^^^^^^^^^ Focused spec found. + focus 'test' do; end + ^^^^^^^^^^^^ Focused spec found. + RUBY + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/hook_argument_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/hook_argument_spec.rb new file mode 100644 index 0000000000..7125d33f50 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/hook_argument_spec.rb @@ -0,0 +1,171 @@ +RSpec.describe RuboCop::Cop::RSpec::HookArgument, :config do + subject(:cop) { described_class.new(config) } + + let(:cop_config) do + { 'EnforcedStyle' => enforced_style } + end + + shared_examples 'ignored hooks' do + it 'ignores :context and :suite' do + expect_no_offenses(<<-RUBY) + before(:suite) { true } + after(:suite) { true } + before(:context) { true } + after(:context) { true } + RUBY + end + + it 'ignores hooks with more than one argument' do + expect_no_offenses(<<-RUBY) + before(:each, :something_custom) { true } + RUBY + end + + it 'ignores non-rspec hooks' do + expect_no_offenses(<<-RUBY) + setup(:each) { true } + RUBY + end + end + + shared_examples 'hook autocorrect' do |output| + include_examples 'autocorrect', 'before(:each) { }', output + include_examples 'autocorrect', 'before(:example) { }', output + include_examples 'autocorrect', 'before { }', output + + include_examples 'autocorrect', 'config.before(:each) { }', + 'config.' + output + include_examples 'autocorrect', 'config.before(:example) { }', + 'config.' + output + include_examples 'autocorrect', 'config.before { }', + 'config.' + output + end + + shared_examples 'an example hook' do + include_examples 'ignored hooks' + include_examples 'detects style', 'before(:each) { foo }', 'each' + include_examples 'detects style', 'before(:example) { foo }', 'example' + include_examples 'detects style', 'before { foo }', 'implicit' + end + + context 'when EnforcedStyle is :implicit' do + let(:enforced_style) { :implicit } + + it 'detects :each for hooks' do + expect_offense(<<-RUBY) + before(:each) { true } + ^^^^^^^^^^^^^ Omit the default `:each` argument for RSpec hooks. + after(:each) { true } + ^^^^^^^^^^^^ Omit the default `:each` argument for RSpec hooks. + around(:each) { true } + ^^^^^^^^^^^^^ Omit the default `:each` argument for RSpec hooks. + config.after(:each) { true } + ^^^^^^^^^^^^^^^^^^^ Omit the default `:each` argument for RSpec hooks. + RUBY + end + + it 'detects :example for hooks' do + expect_offense(<<-RUBY) + before(:example) { true } + ^^^^^^^^^^^^^^^^ Omit the default `:example` argument for RSpec hooks. + after(:example) { true } + ^^^^^^^^^^^^^^^ Omit the default `:example` argument for RSpec hooks. + around(:example) { true } + ^^^^^^^^^^^^^^^^ Omit the default `:example` argument for RSpec hooks. + config.before(:example) { true } + ^^^^^^^^^^^^^^^^^^^^^^^ Omit the default `:example` argument for RSpec hooks. + RUBY + end + + it 'does not flag hooks without default scopes' do + expect_no_offenses(<<-RUBY) + before { true } + after { true } + config.before { true } + RUBY + end + + include_examples 'an example hook' + include_examples 'hook autocorrect', 'before { }' + end + + context 'when EnforcedStyle is :each' do + let(:enforced_style) { :each } + + it 'detects :each for hooks' do + expect_no_offenses(<<-RUBY) + before(:each) { true } + after(:each) { true } + around(:each) { true } + config.before(:each) { true } + RUBY + end + + it 'detects :example for hooks' do + expect_offense(<<-RUBY) + before(:example) { true } + ^^^^^^^^^^^^^^^^ Use `:each` for RSpec hooks. + after(:example) { true } + ^^^^^^^^^^^^^^^ Use `:each` for RSpec hooks. + around(:example) { true } + ^^^^^^^^^^^^^^^^ Use `:each` for RSpec hooks. + config.before(:example) { true } + ^^^^^^^^^^^^^^^^^^^^^^^ Use `:each` for RSpec hooks. + RUBY + end + + it 'detects hooks without default scopes' do + expect_offense(<<-RUBY) + before { true } + ^^^^^^ Use `:each` for RSpec hooks. + after { true } + ^^^^^ Use `:each` for RSpec hooks. + config.before { true } + ^^^^^^ Use `:each` for RSpec hooks. + RUBY + end + + include_examples 'an example hook' + include_examples 'hook autocorrect', 'before(:each) { }' + end + + context 'when EnforcedStyle is :example' do + let(:enforced_style) { :example } + + it 'detects :example for hooks' do + expect_no_offenses(<<-RUBY) + before(:example) { true } + after(:example) { true } + around(:example) { true } + config.before(:example) { true } + RUBY + end + + it 'detects :each for hooks' do + expect_offense(<<-RUBY) + before(:each) { true } + ^^^^^^^^^^^^^ Use `:example` for RSpec hooks. + after(:each) { true } + ^^^^^^^^^^^^ Use `:example` for RSpec hooks. + around(:each) { true } + ^^^^^^^^^^^^^ Use `:example` for RSpec hooks. + config.before(:each) { true } + ^^^^^^^^^^^^^^^^^^^^ Use `:example` for RSpec hooks. + RUBY + end + + it 'does not flag hooks without default scopes' do + expect_offense(<<-RUBY) + before { true } + ^^^^^^ Use `:example` for RSpec hooks. + after { true } + ^^^^^ Use `:example` for RSpec hooks. + config.before { true } + ^^^^^^ Use `:example` for RSpec hooks. + RUBY + end + + include_examples 'an example hook' + include_examples 'hook autocorrect', 'before(:example) { }' + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/hooks_before_examples_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/hooks_before_examples_spec.rb new file mode 100644 index 0000000000..90f77ab0f9 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/hooks_before_examples_spec.rb @@ -0,0 +1,135 @@ +RSpec.describe RuboCop::Cop::RSpec::HooksBeforeExamples do + subject(:cop) { described_class.new } + + it 'flags `before` after `it`' do + expect_offense(<<-RUBY) + RSpec.describe User do + it { is_expected.to be_after_let } + before { setup } + ^^^^^^^^^^^^^^^^ Move `before` above the examples in the group. + end + RUBY + end + + it 'flags `before` after `context`' do + expect_offense(<<-RUBY) + RSpec.describe User do + context 'a context' do + it { is_expected.to be_after_let } + end + + before { setup } + ^^^^^^^^^^^^^^^^ Move `before` above the examples in the group. + end + RUBY + end + + it 'flags `before` after `include_examples`' do + expect_offense(<<-RUBY) + RSpec.describe User do + include_examples('should be after let') + + before { setup } + ^^^^^^^^^^^^^^^^ Move `before` above the examples in the group. + end + RUBY + end + + it 'flags `after` after an example' do + expect_offense(<<-RUBY) + RSpec.describe User do + it { is_expected.to be_after_let } + after { cleanup } + ^^^^^^^^^^^^^^^^^ Move `after` above the examples in the group. + end + RUBY + end + + it 'flags scoped hook after an example' do + expect_offense(<<-RUBY) + RSpec.describe User do + it { is_expected.to be_after_let } + before(:each) { cleanup } + ^^^^^^^^^^^^^^^^^^^^^^^^^ Move `before` above the examples in the group. + end + RUBY + end + + it 'does not flag hooks before the examples' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + before(:each) { setup } + after(:each) { cleanup } + + it { is_expected.to be_after_let } + + context 'a context' do + it { is_expected.to work } + end + + include_examples('everything is fine') + end + RUBY + end + + it 'does not flag `before` in a nested context' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + before { setup } + + context 'something else' do + before { additional_setup } + it { is_expected.to work } + end + + include_examples('everything is fine') + end + RUBY + end + + it 'allows inclusion of context before hooks' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + include_context 'special user' + + before { setup } + end + RUBY + end + + it 'ignores single-line example blocks' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + include_examples 'special user' do + before { setup } + end + end + RUBY + end + + bad_code = <<-RUBY + RSpec.describe User do + include_examples('should be after hook') + context 'another one' do + before { another_setup } + include_examples('should be ok') + end + + after { cleanup } + end + RUBY + + good_code = <<-RUBY + RSpec.describe User do + after { cleanup } + include_examples('should be after hook') + context 'another one' do + before { another_setup } + include_examples('should be ok') + end + + end + RUBY + + include_examples 'autocorrect', bad_code, good_code +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/implicit_expect_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/implicit_expect_spec.rb new file mode 100644 index 0000000000..093e6b2378 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/implicit_expect_spec.rb @@ -0,0 +1,101 @@ +# frozen_string_literal: true + +RSpec.describe RuboCop::Cop::RSpec::ImplicitExpect, :config do + subject(:cop) { described_class.new(config) } + + context 'when EnforcedStyle is is_expected' do + let(:cop_config) do + { 'EnforcedStyle' => 'is_expected' } + end + + it 'flags it { should }' do + expect_offense(<<-RUBY) + it { should be_truthy } + ^^^^^^ Prefer `is_expected.to` over `should`. + RUBY + end + + it 'flags it { should_not }' do + expect_offense(<<-RUBY) + it { should_not be_truthy } + ^^^^^^^^^^ Prefer `is_expected.to_not` over `should_not`. + RUBY + end + + it 'approves of is_expected.to' do + expect_no_offenses('it { is_expected.to be_truthy }') + end + + it 'approves of is_expected.to_not' do + expect_no_offenses('it { is_expected.to_not be_truthy }') + end + + it 'approves of is_expected.not_to' do + expect_no_offenses('it { is_expected.not_to be_truthy }') + end + + include_examples 'detects style', 'it { should be_truthy }', 'should' + include_examples 'autocorrect', + 'it { should be_truthy }', + 'it { is_expected.to be_truthy }' + + include_examples 'autocorrect', + 'it { should_not be_truthy }', + 'it { is_expected.to_not be_truthy }' + end + + context 'when EnforcedStyle is should' do + let(:cop_config) do + { 'EnforcedStyle' => 'should' } + end + + it 'flags it { is_expected.to }' do + expect_offense(<<-RUBY) + it { is_expected.to be_truthy } + ^^^^^^^^^^^^^^ Prefer `should` over `is_expected.to`. + RUBY + end + + it 'flags it { is_expected.to_not }' do + expect_offense(<<-RUBY) + it { is_expected.to_not be_truthy } + ^^^^^^^^^^^^^^^^^^ Prefer `should_not` over `is_expected.to_not`. + RUBY + end + + it 'flags it { is_expected.not_to }' do + expect_offense(<<-RUBY) + it { is_expected.not_to be_truthy } + ^^^^^^^^^^^^^^^^^^ Prefer `should_not` over `is_expected.not_to`. + RUBY + end + + it 'approves of should' do + expect_no_offenses('it { should be_truthy }') + end + + it 'approves of should_not' do + expect_no_offenses('it { should_not be_truthy }') + end + + include_examples 'detects style', + 'it { is_expected.to be_truthy }', + 'is_expected' + + include_examples 'detects style', + 'it { should be_truthy }', + 'should' + + include_examples 'autocorrect', + 'it { is_expected.to be_truthy }', + 'it { should be_truthy }' + + include_examples 'autocorrect', + 'it { is_expected.to_not be_truthy }', + 'it { should_not be_truthy }' + + include_examples 'autocorrect', + 'it { is_expected.not_to be_truthy }', + 'it { should_not be_truthy }' + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/implicit_subject_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/implicit_subject_spec.rb new file mode 100644 index 0000000000..75cc130d25 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/implicit_subject_spec.rb @@ -0,0 +1,200 @@ +RSpec.describe RuboCop::Cop::RSpec::ImplicitSubject, :config do + subject(:cop) { described_class.new(config) } + + let(:cop_config) do + { 'EnforcedStyle' => enforced_style } + end + + context 'with EnforcedStyle `single_line_only`' do + let(:enforced_style) { 'single_line_only' } + + it 'flags `is_expected` in multi-line examples' do + expect_offense(<<-RUBY) + it 'expect subject to be used' do + is_expected.to be_good + ^^^^^^^^^^^ Don't use implicit subject. + end + RUBY + end + + it 'allows `is_expected` inside `its` block, in multi-line examples' do + expect_no_offenses(<<-RUBY) + its(:quality) do + is_expected.to be :high + end + RUBY + end + + it 'flags `should` in multi-line examples' do + expect_offense(<<-RUBY) + it 'expect subject to be used' do + should be_good + ^^^^^^^^^^^^^^ Don't use implicit subject. + end + RUBY + end + + it 'allows `is_expected` in single-line examples' do + expect_no_offenses(<<-RUBY) + it { is_expected.to be_good } + RUBY + end + + it 'allows `should` in single-line examples' do + expect_no_offenses(<<-RUBY) + it { should be_good } + RUBY + end + + it 'does not flag methods called is_expected and should' do + expect_no_offenses(<<-RUBY) + it 'uses some similar sounding methods' do + expect(baz).to receive(:is_expected) + baz.is_expected + foo.should(deny_access) + end + RUBY + end + + it 'detects usage of `is_expected` inside helper methods' do + expect_offense(<<-RUBY) + def permits(actions) + actions.each { |action| is_expected.to permit_action(action) } + ^^^^^^^^^^^ Don't use implicit subject. + end + RUBY + end + + bad_code = <<-RUBY + it 'works' do + is_expected.to be_truthy + end + RUBY + + good_code = <<-RUBY + it 'works' do + expect(subject).to be_truthy + end + RUBY + + include_examples 'autocorrect', + bad_code, + good_code + + bad_code = <<-RUBY + it 'works' do + should be_truthy + should_not be_falsy + end + RUBY + + good_code = <<-RUBY + it 'works' do + expect(subject).to be_truthy + expect(subject).not_to be_falsy + end + RUBY + + include_examples 'autocorrect', + bad_code, + good_code + end + + context 'with EnforcedStyle `single_statement_only`' do + let(:enforced_style) { 'single_statement_only' } + + it 'allows `is_expected` in multi-line example with single statement' do + expect_no_offenses(<<-RUBY) + it 'expect subject to be used' do + is_expected.to be_good + end + RUBY + end + + it 'flags `is_expected` in multi-statement examples' do + expect_offense(<<-RUBY) + it 'expect subject to be used' do + subject.age = 18 + is_expected.to be_valid + ^^^^^^^^^^^ Don't use implicit subject. + end + RUBY + end + + bad_code = <<-RUBY + it 'is valid' do + subject.age = 18 + is_expected.to be_valid + end + RUBY + + good_code = <<-RUBY + it 'is valid' do + subject.age = 18 + expect(subject).to be_valid + end + RUBY + + include_examples 'autocorrect', + bad_code, + good_code + + include_examples 'autocorrect', + bad_code, + good_code + end + + context 'with EnforcedStyle `disallow`' do + let(:enforced_style) { 'disallow' } + + it 'flags `is_expected` in multi-line examples' do + expect_offense(<<-RUBY) + it 'expect subject to be used' do + is_expected.to be_good + ^^^^^^^^^^^ Don't use implicit subject. + end + RUBY + end + + it 'flags `is_expected` in single-line examples' do + expect_offense(<<-RUBY) + it { is_expected.to be_good } + ^^^^^^^^^^^ Don't use implicit subject. + RUBY + end + + it 'flags `should` in multi-line examples' do + expect_offense(<<-RUBY) + it 'expect subject to be used' do + should be_good + ^^^^^^^^^^^^^^ Don't use implicit subject. + end + RUBY + end + + it 'flags `should` in single-line examples' do + expect_offense(<<-RUBY) + it { should be_good } + ^^^^^^^^^^^^^^ Don't use implicit subject. + RUBY + end + + it 'allows `is_expected` inside `its` block' do + expect_no_offenses(<<-RUBY) + its(:quality) { is_expected.to be :high } + RUBY + end + + include_examples 'autocorrect', + 'it { is_expected.to be_truthy }', + 'it { expect(subject).to be_truthy }' + + include_examples 'autocorrect', + 'it { should be_truthy }', + 'it { expect(subject).to be_truthy }' + + include_examples 'autocorrect', + 'it { should_not be_truthy }', + 'it { expect(subject).not_to be_truthy }' + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/instance_spy_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/instance_spy_spec.rb new file mode 100644 index 0000000000..7d58e0e6a8 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/instance_spy_spec.rb @@ -0,0 +1,60 @@ +RSpec.describe RuboCop::Cop::RSpec::InstanceSpy do + subject(:cop) { described_class.new } + + context 'when used with `have_received`' do + it 'adds an offense for an instance_double with single argument' do + expect_offense(<<-RUBY) + it do + foo = instance_double(Foo).as_null_object + ^^^^^^^^^^^^^^^^^^^^ Use `instance_spy` when you check your double with `have_received`. + expect(foo).to have_received(:bar) + end + RUBY + end + + it 'adds an offense for an instance_double with multiple arguments' do + expect_offense(<<-RUBY) + it do + foo = instance_double(Foo, :name).as_null_object + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use `instance_spy` when you check your double with `have_received`. + expect(foo).to have_received(:bar) + end + RUBY + end + + it 'ignores instance_double when it is not used with as_null_object' do + expect_no_offenses(<<-RUBY) + it do + foo = instance_double(Foo) + expect(bar).to have_received(:bar) + end + RUBY + end + end + + context 'when not used with `have_received`' do + it 'does not add an offence' do + expect_no_offenses(<<-RUBY) + it do + foo = instance_double(Foo).as_null_object + expect(bar).to have_received(:bar) + end + RUBY + end + end + + original = <<-RUBY + it do + foo = instance_double(Foo, :name).as_null_object + expect(foo).to have_received(:bar) + end + RUBY + corrected = <<-RUBY + it do + foo = instance_spy(Foo, :name) + expect(foo).to have_received(:bar) + end + RUBY + + include_examples 'autocorrect', original, corrected +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/instance_variable_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/instance_variable_spec.rb new file mode 100644 index 0000000000..36373eaff8 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/instance_variable_spec.rb @@ -0,0 +1,93 @@ +RSpec.describe RuboCop::Cop::RSpec::InstanceVariable do + subject(:cop) { described_class.new } + + it 'finds an instance variable inside a describe' do + expect_offense(<<-RUBY) + describe MyClass do + before { @foo = [] } + it { expect(@foo).to be_empty } + ^^^^ Replace instance variable with local variable or `let`. + end + RUBY + end + + it 'ignores non-spec blocks' do + expect_no_offenses(<<-RUBY) + not_rspec do + before { @foo = [] } + it { expect(@foo).to be_empty } + end + RUBY + end + + it 'finds an instance variable inside a shared example' do + expect_offense(<<-RUBY) + shared_examples 'shared example' do + it { expect(@foo).to be_empty } + ^^^^ Replace instance variable with local variable or `let`. + end + RUBY + end + + it 'ignores an instance variable without describe' do + expect_no_offenses(<<-RUBY) + @foo = [] + @foo.empty? + RUBY + end + + it 'ignores an instance variable inside a dynamic class' do + expect_no_offenses(<<-RUBY) + describe MyClass do + let(:object) do + Class.new(OtherClass) do + def initialize(resource) + @resource = resource + end + + def serialize + @resource.to_json + end + end + end + end + RUBY + end + + # Regression test for nevir/rubocop-rspec#115 + it 'ignores instance variables outside of specs' do + expect_no_offenses(<<-RUBY, 'lib/source_code.rb') + feature do + @foo = bar + + @foo + end + RUBY + end + + context 'when configured with AssignmentOnly', :config do + subject(:cop) { described_class.new(config) } + + let(:cop_config) do + { 'AssignmentOnly' => true } + end + + it 'flags an instance variable when it is also assigned' do + expect_offense(<<-RUBY) + describe MyClass do + before { @foo = [] } + it { expect(@foo).to be_empty } + ^^^^ Replace instance variable with local variable or `let`. + end + RUBY + end + + it 'ignores an instance variable when it is not assigned' do + expect_no_offenses(<<-RUBY) + describe MyClass do + it { expect(@foo).to be_empty } + end + RUBY + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/invalid_predicate_matcher_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/invalid_predicate_matcher_spec.rb new file mode 100644 index 0000000000..a768a29f6b --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/invalid_predicate_matcher_spec.rb @@ -0,0 +1,37 @@ +RSpec.describe RuboCop::Cop::RSpec::InvalidPredicateMatcher do + subject(:cop) { described_class.new } + + it 'registers an offense for double question' do + expect_offense(<<-RUBY) + expect(foo).to be_something? + ^^^^^^^^^^^^^ Omit `?` from `be_something?`. + RUBY + end + + it 'registers an offense for double question with `not_to`' do + expect_offense(<<-RUBY) + expect(foo).not_to be_something? + ^^^^^^^^^^^^^ Omit `?` from `be_something?`. + RUBY + end + + it 'registers an offense for double question with `to_not`' do + expect_offense(<<-RUBY) + expect(foo).to_not be_something? + ^^^^^^^^^^^^^ Omit `?` from `be_something?`. + RUBY + end + + it 'registers an offense for double question with `have_something?`' do + expect_offense(<<-RUBY) + expect(foo).to have_something? + ^^^^^^^^^^^^^^^ Omit `?` from `have_something?`. + RUBY + end + + it 'accepts valid predicate matcher' do + expect_no_offenses(<<-RUBY) + expect(foo).to be_something + RUBY + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/it_behaves_like_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/it_behaves_like_spec.rb new file mode 100644 index 0000000000..90494b12e8 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/it_behaves_like_spec.rb @@ -0,0 +1,49 @@ +RSpec.describe RuboCop::Cop::RSpec::ItBehavesLike, :config do + subject(:cop) { described_class.new(config) } + + let(:cop_config) do + { 'EnforcedStyle' => enforced_style } + end + + context 'when the enforced style is `it_behaves_like`' do + let(:enforced_style) { :it_behaves_like } + + it 'flags a violation for it_should_behave_like' do + expect_offense(<<-RUBY) + it_should_behave_like 'a foo' + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `it_behaves_like` over `it_should_behave_like` when including examples in a nested context. + RUBY + end + + it 'does not flag a violation for it_behaves_like' do + expect_no_offenses("it_behaves_like 'a foo'") + end + + include_examples( + 'autocorrect', + "foo(); it_should_behave_like 'a foo'", + "foo(); it_behaves_like 'a foo'" + ) + end + + context 'when the enforced style is `it_should_behave_like`' do + let(:enforced_style) { :it_should_behave_like } + + it 'flags a violation for it_behaves_like' do + expect_offense(<<-RUBY) + it_behaves_like 'a foo' + ^^^^^^^^^^^^^^^^^^^^^^^ Prefer `it_should_behave_like` over `it_behaves_like` when including examples in a nested context. + RUBY + end + + it 'does not flag a violation for it_behaves_like' do + expect_no_offenses("it_should_behave_like 'a foo'") + end + + include_examples( + 'autocorrect', + "foo(); it_behaves_like 'a foo'", + "foo(); it_should_behave_like 'a foo'" + ) + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/iterated_expectation_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/iterated_expectation_spec.rb new file mode 100644 index 0000000000..8e7032694d --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/iterated_expectation_spec.rb @@ -0,0 +1,80 @@ +RSpec.describe RuboCop::Cop::RSpec::IteratedExpectation do + subject(:cop) { described_class.new } + + it 'flags `each` with an expectation' do + expect_offense(<<-RUBY) + it 'validates users' do + [user1, user2, user3].each { |user| expect(user).to be_valid } + ^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using the `all` matcher instead of iterating over an array. + end + RUBY + end + + it 'flags `each` when expectation calls method with arguments' do + expect_offense(<<-RUBY) + it 'validates users' do + [user1, user2, user3].each { |user| expect(user).to be_a(User) } + ^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using the `all` matcher instead of iterating over an array. + end + RUBY + end + + it 'ignores `each` without expectation' do + expect_no_offenses(<<-RUBY) + it 'validates users' do + [user1, user2, user3].each { |user| allow(user).to receive(:method) } + end + RUBY + end + + it 'flags `each` with multiple expectations' do + expect_offense(<<-RUBY) + it 'validates users' do + [user1, user2, user3].each do |user| + ^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using the `all` matcher instead of iterating over an array. + expect(user).to receive(:method) + expect(user).to receive(:other_method) + end + end + RUBY + end + + it 'ignore `each` when the body does not contain only expectations' do + expect_no_offenses(<<-RUBY) + it 'validates users' do + [user1, user2, user3].each do |user| + allow(Something).to receive(:method).and_return(user) + expect(user).to receive(:method) + expect(user).to receive(:other_method) + end + end + RUBY + end + + it 'ignores `each` with expectation on property' do + expect_no_offenses(<<-RUBY) + it 'validates users' do + [user1, user2, user3].each { |user| expect(user.name).to be } + end + RUBY + end + + it 'ignores assignments in the iteration' do + expect_no_offenses(<<-RUBY) + it 'validates users' do + [user1, user2, user3].each { |user| array = array.concat(user) } + end + RUBY + end + + it 'ignores `each` when there is a negative expectation' do + expect_no_offenses(<<-RUBY) + it 'validates users' do + [user1, user2, user3].each do |user| + expect(user).not_to receive(:method) + expect(user).to receive(:other_method) + end + end + RUBY + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/leading_subject_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/leading_subject_spec.rb new file mode 100644 index 0000000000..bb9b04458d --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/leading_subject_spec.rb @@ -0,0 +1,135 @@ +# frozen_string_literal: true + +RSpec.describe RuboCop::Cop::RSpec::LeadingSubject do + subject(:cop) { described_class.new } + + it 'checks subject below let' do + expect_offense(<<-RUBY) + RSpec.describe User do + let(:params) { foo } + + subject { described_class.new } + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Declare `subject` above any other `let` declarations. + end + RUBY + end + + it 'checks subject below let!' do + expect_offense(<<-RUBY) + RSpec.describe User do + let!(:params) { foo } + + subject { described_class.new } + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Declare `subject` above any other `let!` declarations. + end + RUBY + end + + it 'approves of subject above let' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + context 'blah' do + end + + subject { described_class.new } + + let(:params) { foo } + end + RUBY + end + + it 'handles subjects in contexts' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + let(:params) { foo } + + context "when something happens" do + subject { described_class.new } + end + end + RUBY + end + + it 'handles subjects in tests' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + # This shouldn't really ever happen in a sane codebase but I still + # want to avoid false positives + it "doesn't mind me calling a method called subject in the test" do + let(foo) + subject { bar } + end + end + RUBY + end + + it 'checks subject below hook' do + expect_offense(<<-RUBY) + RSpec.describe User do + before { allow(Foo).to receive(:bar) } + + subject { described_class.new } + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Declare `subject` above any other `before` declarations. + end + RUBY + end + + it 'checks subject below example' do + expect_offense(<<-RUBY) + RSpec.describe User do + it { is_expected.to be_present } + + subject { described_class.new } + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Declare `subject` above any other `it` declarations. + end + RUBY + end + + bad_code = <<-RUBY + RSpec.describe User do + before { allow(Foo).to receive(:bar) } + let(:params) { foo } + let(:bar) { baz } + + subject { described_class.new } + it { is_expected.to do_something } + end + RUBY + + good_code = <<-RUBY + RSpec.describe User do + subject { described_class.new } + before { allow(Foo).to receive(:bar) } + let(:params) { foo } + let(:bar) { baz } + + it { is_expected.to do_something } + end + RUBY + + include_examples 'autocorrect', bad_code, good_code + + bad_code = <<-RUBY + RSpec.describe User do + let(:params) { foo } + let(:bar) { baz } + subject do + described_class.new + end + it { is_expected.to do_something } + end + RUBY + + good_code = <<-RUBY + RSpec.describe User do + subject do + described_class.new + end + let(:params) { foo } + let(:bar) { baz } + it { is_expected.to do_something } + end + RUBY + + include_examples 'autocorrect', bad_code, good_code +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/let_before_examples_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/let_before_examples_spec.rb new file mode 100644 index 0000000000..730736cc86 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/let_before_examples_spec.rb @@ -0,0 +1,136 @@ +RSpec.describe RuboCop::Cop::RSpec::LetBeforeExamples do + subject(:cop) { described_class.new } + + it 'flags `let` after `it`' do + expect_offense(<<-RUBY) + RSpec.describe User do + it { is_expected.to be_after_let } + let(:foo) { bar } + ^^^^^^^^^^^^^^^^^ Move `let` before the examples in the group. + end + RUBY + end + + it 'flags `let` after `context`' do + expect_offense(<<-RUBY) + RSpec.describe User do + context 'a context' do + it { is_expected.to be_after_let } + end + + let(:foo) { bar } + ^^^^^^^^^^^^^^^^^ Move `let` before the examples in the group. + end + RUBY + end + + it 'flags `let` after `include_examples`' do + expect_offense(<<-RUBY) + RSpec.describe User do + include_examples('should be after let') + + let(:foo) { bar } + ^^^^^^^^^^^^^^^^^ Move `let` before the examples in the group. + end + RUBY + end + + it 'does not flag `let` before the examples' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + let(:foo) { bar } + + it { is_expected.to be_after_let } + + context 'a context' do + it { is_expected.to work } + end + + include_examples('everything is fine') + end + RUBY + end + + it 'does not flag `let` in a nested context' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + let(:foo) { bar } + + context 'something else' do + let(:foo) { baz } + it { is_expected.to work } + end + + include_examples('everything is fine') + end + RUBY + end + + it 'allows inclusion of context before `let`' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + include_context 'special user' + + let(:foo) { bar } + end + RUBY + end + + it 'ignores single-line example blocks' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + include_examples 'special user' do + let(:foo) { bar } + end + end + RUBY + end + + bad_code = <<-RUBY + RSpec.describe User do + include_examples('should be after let') + context 'another one' do + let(:foo) { baz } + include_examples('should be ok') + end + + let(:foo) { bar } + end + RUBY + + good_code = <<-RUBY + RSpec.describe User do + let(:foo) { bar } + include_examples('should be after let') + context 'another one' do + let(:foo) { baz } + include_examples('should be ok') + end + + end + RUBY + + include_examples 'autocorrect', bad_code, good_code + + bad_code = <<-RUBY + RSpec.describe User do + include_examples('should be after let') + + let(:foo) { (<<-SOURCE) } + some long text here + SOURCE + end + RUBY + + good_code = <<-RUBY + RSpec.describe User do + let(:foo) { (<<-SOURCE) } + some long text here + SOURCE + include_examples('should be after let') + + end + RUBY + + include_examples 'autocorrect', bad_code, good_code +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/let_setup_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/let_setup_spec.rb new file mode 100644 index 0000000000..054dbbe43d --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/let_setup_spec.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +RSpec.describe RuboCop::Cop::RSpec::LetSetup do + subject(:cop) { described_class.new } + + it 'complains when let! is used and not referenced' do + expect_offense(<<-RUBY) + describe Foo do + let!(:foo) { bar } + ^^^^^^^^^^ Do not use `let!` for test setup. + + it 'does not use foo' do + expect(baz).to eq(qux) + end + end + RUBY + end + + it 'ignores let! when used in `before`' do + expect_no_offenses(<<-RUBY) + describe Foo do + let!(:foo) { bar } + + before do + foo + end + + it 'does not use foo' do + expect(baz).to eq(qux) + end + end + RUBY + end + + it 'ignores let! when used in example' do + expect_no_offenses(<<-RUBY) + describe Foo do + let!(:foo) { bar } + + it 'uses foo' do + foo + expect(baz).to eq(qux) + end + end + RUBY + end + + it 'complains when let! is used and not referenced within nested group' do + expect_offense(<<-RUBY) + describe Foo do + context 'when something special happens' do + let!(:foo) { bar } + ^^^^^^^^^^ Do not use `let!` for test setup. + + it 'does not use foo' do + expect(baz).to eq(qux) + end + end + + it 'references some other foo' do + foo + end + end + RUBY + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/message_chain_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/message_chain_spec.rb new file mode 100644 index 0000000000..cbfaa9055f --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/message_chain_spec.rb @@ -0,0 +1,21 @@ +RSpec.describe RuboCop::Cop::RSpec::MessageChain do + subject(:cop) { described_class.new } + + it 'finds `receive_message_chain`' do + expect_offense(<<-RUBY) + before do + allow(foo).to receive_message_chain(:one, :two) { :three } + ^^^^^^^^^^^^^^^^^^^^^ Avoid stubbing using `receive_message_chain`. + end + RUBY + end + + it 'finds old `stub_chain` syntax' do + expect_offense(<<-RUBY) + before do + foo.stub_chain(:one, :two).and_return(:three) + ^^^^^^^^^^ Avoid stubbing using `stub_chain`. + end + RUBY + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/message_expectation_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/message_expectation_spec.rb new file mode 100644 index 0000000000..3d7a63dfc9 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/message_expectation_spec.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +RSpec.describe RuboCop::Cop::RSpec::MessageExpectation, :config do + subject(:cop) { described_class.new(config) } + + context 'when EnforcedStyle is allow' do + let(:cop_config) do + { 'EnforcedStyle' => 'allow' } + end + + it 'flags expect(...).to receive' do + expect_offense(<<-RUBY) + expect(foo).to receive(:bar) + ^^^^^^ Prefer `allow` for setting message expectations. + RUBY + end + + it 'approves of allow(...).to receive' do + expect_no_offenses('allow(foo).to receive(:bar)') + end + + include_examples 'detects style', 'allow(foo).to receive(:bar)', 'allow' + include_examples 'detects style', 'expect(foo).to receive(:bar)', 'expect' + end + + context 'when EnforcedStyle is expect' do + let(:cop_config) do + { 'EnforcedStyle' => 'expect' } + end + + it 'flags allow(...).to receive' do + expect_offense(<<-RUBY) + allow(foo).to receive(:bar) + ^^^^^ Prefer `expect` for setting message expectations. + RUBY + end + + it 'approves of expect(...).to receive' do + expect_no_offenses('expect(foo).to receive(:bar)') + end + + include_examples 'detects style', 'expect(foo).to receive(:bar)', 'expect' + include_examples 'detects style', 'allow(foo).to receive(:bar)', 'allow' + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/message_spies_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/message_spies_spec.rb new file mode 100644 index 0000000000..fe6bce12f5 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/message_spies_spec.rb @@ -0,0 +1,151 @@ +# frozen_string_literal: true + +RSpec.describe RuboCop::Cop::RSpec::MessageSpies, :config do + subject(:cop) { described_class.new(config) } + + context 'when EnforcedStyle is have_received' do + let(:cop_config) do + { 'EnforcedStyle' => 'have_received' } + end + + it 'flags expect(send).to receive' do + expect_offense(<<-RUBY) + expect(foo).to receive(:bar) + ^^^^^^^ Prefer `have_received` for setting message expectations. Setup `foo` as a spy using `allow` or `instance_spy`. + RUBY + end + + it 'flags expect(lvar).to receive' do + expect_offense(<<-RUBY) + foo = baz + expect(foo).to receive(:bar) + ^^^^^^^ Prefer `have_received` for setting message expectations. Setup `foo` as a spy using `allow` or `instance_spy`. + RUBY + end + + it 'flags expect(ivar).to receive' do + expect_offense(<<-RUBY) + expect(@foo).to receive(:bar) + ^^^^^^^ Prefer `have_received` for setting message expectations. Setup `@foo` as a spy using `allow` or `instance_spy`. + RUBY + end + + it 'flags expect(const).to receive' do + expect_offense(<<-RUBY) + expect(Foo).to receive(:bar) + ^^^^^^^ Prefer `have_received` for setting message expectations. Setup `Foo` as a spy using `allow` or `instance_spy`. + RUBY + end + + it 'flags expect(...).not_to receive' do + expect_offense(<<-RUBY) + expect(foo).not_to receive(:bar) + ^^^^^^^ Prefer `have_received` for setting message expectations. Setup `foo` as a spy using `allow` or `instance_spy`. + RUBY + end + + it 'flags expect(...).to_not receive' do + expect_offense(<<-RUBY) + expect(foo).to_not receive(:bar) + ^^^^^^^ Prefer `have_received` for setting message expectations. Setup `foo` as a spy using `allow` or `instance_spy`. + RUBY + end + + it 'flags expect(...).to receive with' do + expect_offense(<<-RUBY) + expect(foo).to receive(:bar).with(:baz) + ^^^^^^^ Prefer `have_received` for setting message expectations. Setup `foo` as a spy using `allow` or `instance_spy`. + RUBY + end + + it 'flags expect(...).to receive at_most' do + expect_offense(<<-RUBY) + expect(foo).to receive(:bar).at_most(42).times + ^^^^^^^ Prefer `have_received` for setting message expectations. Setup `foo` as a spy using `allow` or `instance_spy`. + RUBY + end + + it 'approves of expect(...).to have_received' do + expect_no_offenses('expect(foo).to have_received(:bar)') + end + + include_examples 'detects style', 'expect(foo).to receive(:bar)', 'receive' + + include_examples 'detects style', + 'expect(foo).to have_received(:bar)', + 'have_received' + end + + context 'when EnforcedStyle is receive' do + let(:cop_config) do + { 'EnforcedStyle' => 'receive' } + end + + it 'flags expect(send).to have_received' do + expect_offense(<<-RUBY) + expect(foo).to have_received(:bar) + ^^^^^^^^^^^^^ Prefer `receive` for setting message expectations. + RUBY + end + + it 'flags expect(lvar).to have_received' do + expect_offense(<<-RUBY) + foo = baz + expect(foo).to have_received(:bar) + ^^^^^^^^^^^^^ Prefer `receive` for setting message expectations. + RUBY + end + + it 'flags expect(ivar).to have_received' do + expect_offense(<<-RUBY) + expect(@foo).to have_received(:bar) + ^^^^^^^^^^^^^ Prefer `receive` for setting message expectations. + RUBY + end + + it 'flags expect(const).to have_received' do + expect_offense(<<-RUBY) + expect(Foo).to have_received(:bar) + ^^^^^^^^^^^^^ Prefer `receive` for setting message expectations. + RUBY + end + + it 'flags expect(...).not_to have_received' do + expect_offense(<<-RUBY) + expect(foo).not_to have_received(:bar) + ^^^^^^^^^^^^^ Prefer `receive` for setting message expectations. + RUBY + end + + it 'flags expect(...).to_not have_received' do + expect_offense(<<-RUBY) + expect(foo).to_not have_received(:bar) + ^^^^^^^^^^^^^ Prefer `receive` for setting message expectations. + RUBY + end + + it 'flags expect(...).to have_received with' do + expect_offense(<<-RUBY) + expect(foo).to have_received(:bar).with(:baz) + ^^^^^^^^^^^^^ Prefer `receive` for setting message expectations. + RUBY + end + + it 'flags expect(...).to have_received at_most' do + expect_offense(<<-RUBY) + expect(foo).to have_received(:bar).at_most(42).times + ^^^^^^^^^^^^^ Prefer `receive` for setting message expectations. + RUBY + end + + it 'approves of expect(...).to receive' do + expect_no_offenses('expect(foo).to receive(:bar)') + end + + include_examples 'detects style', 'expect(foo).to receive(:bar)', 'receive' + + include_examples 'detects style', + 'expect(foo).to have_received(:bar)', + 'have_received' + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/missing_example_group_argument_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/missing_example_group_argument_spec.rb new file mode 100644 index 0000000000..d205a59494 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/missing_example_group_argument_spec.rb @@ -0,0 +1,55 @@ +RSpec.describe RuboCop::Cop::RSpec::MissingExampleGroupArgument do + subject(:cop) { described_class.new } + + it 'accepts describe with an argument' do + expect_no_offenses(<<-RUBY) + describe FooClass do + end + + RSpec.describe FooClass do + end + RUBY + end + + it 'accepts methods with a name like an example block' do + expect_no_offenses(<<-RUBY) + Scenario.context do + 'static' + end + RUBY + end + + it 'checks first argument of describe' do + expect_offense(<<-RUBY) + describe do + ^^^^^^^^^^^ The first argument to `describe` should not be empty. + end + + RSpec.describe do + ^^^^^^^^^^^^^^^^^ The first argument to `describe` should not be empty. + end + RUBY + end + + it 'checks first argument of nested describe' do + expect_offense(<<-RUBY) + describe FooClass do + describe do + ^^^^^^^^^^^ The first argument to `describe` should not be empty. + end + + RSpec.describe do + ^^^^^^^^^^^^^^^^^ The first argument to `describe` should not be empty. + end + end + RUBY + end + + it 'checks first argument of context' do + expect_offense(<<-RUBY) + context do + ^^^^^^^^^^ The first argument to `context` should not be empty. + end + RUBY + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/multiple_describes_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/multiple_describes_spec.rb new file mode 100644 index 0000000000..cfb1663c18 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/multiple_describes_spec.rb @@ -0,0 +1,28 @@ +RSpec.describe RuboCop::Cop::RSpec::MultipleDescribes do + subject(:cop) { described_class.new } + + it 'finds multiple top level describes with class and method' do + expect_offense(<<-RUBY) + describe MyClass, '.do_something' do; end + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Do not use multiple top level describes - try to nest them. + describe MyClass, '.do_something_else' do; end + RUBY + end + + it 'finds multiple top level describes only with class' do + expect_offense(<<-RUBY) + describe MyClass do; end + ^^^^^^^^^^^^^^^^ Do not use multiple top level describes - try to nest them. + describe MyOtherClass do; end + RUBY + end + + it 'skips single top level describe' do + expect_no_offenses(<<-RUBY) + require 'spec_helper' + + describe MyClass do + end + RUBY + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/multiple_expectations_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/multiple_expectations_spec.rb new file mode 100644 index 0000000000..93d987431e --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/multiple_expectations_spec.rb @@ -0,0 +1,234 @@ +# frozen_string_literal: true + +RSpec.describe RuboCop::Cop::RSpec::MultipleExpectations, :config do + subject(:cop) { described_class.new(config) } + + context 'without configuration' do + let(:cop_config) { {} } + + it 'flags multiple expectations' do + expect_offense(<<-RUBY) + describe Foo do + it 'uses expect twice' do + ^^^^^^^^^^^^^^^^^^^^^^ Example has too many expectations [2/1]. + expect(foo).to eq(bar) + expect(baz).to eq(bar) + end + end + RUBY + end + + it 'approves of one expectation per example' do + expect_no_offenses(<<-RUBY) + describe Foo do + it 'does something neat' do + expect(neat).to be(true) + end + + it 'does something cool' do + expect(cool).to be(true) + end + end + RUBY + end + + it 'flags multiple expect_any_instance_of' do + expect_offense(<<-RUBY) + describe Foo do + it 'uses expect_any_instance_of twice' do + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Example has too many expectations [2/1]. + expect_any_instance_of(Foo).to receive(:bar) + expect_any_instance_of(Foo).to receive(:baz) + end + end + RUBY + end + + it 'flags multiple is_expected' do + expect_offense(<<-RUBY) + describe Foo do + it 'uses expect_any_instance_of twice' do + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Example has too many expectations [2/1]. + is_expected.to receive(:bar) + is_expected.to receive(:baz) + end + end + RUBY + end + + it 'flags multiple expects with blocks' do + expect_offense(<<-RUBY) + describe Foo do + it 'uses expect with block twice' do + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Example has too many expectations [2/1]. + expect { something }.to change(Foo.count) + expect { something }.to change(Bar.count) + end + end + RUBY + end + + it 'counts aggregate_failures as one expectation' do + expect_no_offenses(<<-RUBY) + describe Foo do + it 'aggregates failures' do + aggregate_failures do + expect(foo).to eq(bar) + expect(baz).to eq(bar) + end + end + end + RUBY + end + + it 'counts every aggregate_failures as an expectation' do + expect_offense(<<-RUBY) + describe Foo do + it 'has multiple aggregate_failures calls' do + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Example has too many expectations [2/1]. + aggregate_failures do + end + aggregate_failures do + end + end + end + RUBY + end + end + + context 'with meta data' do + it 'ignores examples with `:aggregate_failures`' do + expect_no_offenses(<<-RUBY) + describe Foo do + it 'uses expect twice', :aggregate_failures do + expect(foo).to eq(bar) + expect(baz).to eq(bar) + end + end + RUBY + end + + it 'ignores examples with `aggregate_failures: true`' do + expect_no_offenses(<<-RUBY) + describe Foo do + it 'uses expect twice', aggregate_failures: true do + expect(foo).to eq(bar) + expect(baz).to eq(bar) + end + end + RUBY + end + + it 'checks examples with `aggregate_failures: false`' do + expect_offense(<<-RUBY) + describe Foo do + it 'uses expect twice', aggregate_failures: false do + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Example has too many expectations [2/1]. + expect(foo).to eq(bar) + expect(baz).to eq(bar) + end + end + RUBY + end + end + + context 'with Max configuration' do + let(:cop_config) do + { 'Max' => '2' } + end + + it 'permits two expectations' do + expect_no_offenses(<<-RUBY) + describe Foo do + it 'uses expect twice' do + expect(foo).to eq(bar) + expect(baz).to eq(bar) + end + end + RUBY + end + + it 'flags three expectations' do + expect_offense(<<-RUBY) + describe Foo do + it 'uses expect three times' do + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Example has too many expectations [3/2]. + expect(foo).to eq(bar) + expect(baz).to eq(bar) + expect(qux).to eq(bar) + end + end + RUBY + end + end + + context 'with AggregateFailuresByDefault configuration' do + let(:cop_config) do + { 'AggregateFailuresByDefault' => true } + end + + it 'ignores examples without metadata' do + expect_no_offenses(<<-RUBY) + describe Foo do + it 'uses expect twice' do + expect(foo).to eq(bar) + expect(baz).to eq(bar) + end + end + RUBY + end + + it 'ignores examples with `:aggregate_failures`' do + expect_no_offenses(<<-RUBY) + describe Foo do + it 'uses expect twice', :aggregate_failures do + expect(foo).to eq(bar) + expect(baz).to eq(bar) + end + end + RUBY + end + + it 'ignores examples with `aggregate_failures: true`' do + expect_no_offenses(<<-RUBY) + describe Foo do + it 'uses expect twice', aggregate_failures: true do + expect(foo).to eq(bar) + expect(baz).to eq(bar) + end + end + RUBY + end + + it 'checks examples with `aggregate_failures: false`' do + expect_offense(<<-RUBY) + describe Foo do + it 'uses expect twice', aggregate_failures: false do + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Example has too many expectations [2/1]. + expect(foo).to eq(bar) + expect(baz).to eq(bar) + end + end + RUBY + end + end + + it 'generates a todo based on the worst violation' do + inspect_source(<<-RUBY, 'spec/foo_spec.rb') + describe Foo do + it 'uses expect twice' do + expect(foo).to eq(bar) + expect(baz).to eq(bar) + end + + it 'uses expect three times' do + expect(foo).to eq(bar) + expect(baz).to eq(bar) + expect(qux).to eq(bar) + end + end + RUBY + + expect(cop.config_to_allow_offenses[:exclude_limit]).to eq('Max' => 3) + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/multiple_subjects_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/multiple_subjects_spec.rb new file mode 100644 index 0000000000..c8151823c2 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/multiple_subjects_spec.rb @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +RSpec.describe RuboCop::Cop::RSpec::MultipleSubjects do + let(:cop) { described_class.new } + + it 'registers an offense for every overwritten subject' do + expect_offense(<<-RUBY) + describe 'hello there' do + subject(:foo) { 1 } + ^^^^^^^^^^^^^^^^^^^ Do not set more than one subject per example group + subject(:bar) { 2 } + ^^^^^^^^^^^^^^^^^^^ Do not set more than one subject per example group + subject { 3 } + ^^^^^^^^^^^^^ Do not set more than one subject per example group + subject(:baz) { 4 } + + describe 'baz' do + subject(:norf) { 1 } + end + end + RUBY + end + + it 'does not try to autocorrect subject!' do + source = <<-RUBY + describe Foo do + subject! { a } + subject! { b } + end + RUBY + + expect(autocorrect_source(source, 'example_spec.rb')).to eql(source) + end + + it 'does not flag shared example groups' do + expect_no_offenses(<<-RUBY) + describe Foo do + it_behaves_like 'user' do + subject { described_class.new(user, described_class) } + + it { expect(subject).not_to be_accessible } + end + + it_behaves_like 'admin' do + subject { described_class.new(user, described_class) } + + it { expect(subject).to be_accessible } + end + end + RUBY + end + + include_examples( + 'autocorrect', + <<-RUBY, + describe 'hello there' do + subject(:foo) { 1 } + subject(:bar) { 2 } + subject(:baz) { 3 } + + describe 'baz' do + subject(:norf) { 1 } + end + end + RUBY + <<-RUBY + describe 'hello there' do + let(:foo) { 1 } + let(:bar) { 2 } + subject(:baz) { 3 } + + describe 'baz' do + subject(:norf) { 1 } + end + end + RUBY + ) + + include_examples( + 'autocorrect', + <<-RUBY.strip_indent.chomp, + describe 'hello there' do + subject { 1 } + subject { 2 } + subject { 3 } + end + RUBY + [ + "describe 'hello there' do", + ' ', + ' ', + ' subject { 3 }', + 'end' + ].join("\n") + ) +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/named_subject_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/named_subject_spec.rb new file mode 100644 index 0000000000..2df55f3e73 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/named_subject_spec.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +RSpec.describe RuboCop::Cop::RSpec::NamedSubject do + subject(:cop) { described_class.new } + + it 'checks `it` and `specify` for explicit subject usage' do + expect_offense(<<-RUBY) + RSpec.describe User do + subject { described_class.new } + + it "is valid" do + expect(subject.valid?).to be(true) + ^^^^^^^ Name your test subject if you need to reference it explicitly. + end + + specify do + expect(subject.valid?).to be(true) + ^^^^^^^ Name your test subject if you need to reference it explicitly. + end + end + RUBY + end + + it 'checks before and after for explicit subject usage' do + expect_offense(<<-RUBY) + RSpec.describe User do + subject { described_class.new } + + before(:each) do + do_something_with(subject) + ^^^^^^^ Name your test subject if you need to reference it explicitly. + end + + after do + do_something_with(subject) + ^^^^^^^ Name your test subject if you need to reference it explicitly. + end + end + RUBY + end + + it 'checks around(:each) for explicit subject usage' do + expect_offense(<<-RUBY) + RSpec.describe User do + subject { described_class.new } + + around(:each) do |test| + do_something_with(subject) + ^^^^^^^ Name your test subject if you need to reference it explicitly. + end + end + RUBY + end + + it 'ignores subject when not wrapped inside a test' do + expect_no_offenses(<<-RUBY) + def foo + it(subject) + end + RUBY + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/nested_groups_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/nested_groups_spec.rb new file mode 100644 index 0000000000..48b01b1685 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/nested_groups_spec.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +RSpec.describe RuboCop::Cop::RSpec::NestedGroups, :config do + subject(:cop) { described_class.new(config) } + + it 'flags nested contexts' do + expect_offense(<<-RUBY) + describe MyClass do + context 'when foo' do + context 'when bar' do + context 'when baz' do + ^^^^^^^^^^^^^^^^^^ Maximum example group nesting exceeded [4/3]. + end + end + end + + context 'when qux' do + context 'when norf' do + end + end + end + RUBY + end + + it 'support --auto-gen-config' do + inspect_source(<<-RUBY, 'spec/foo_spec.rb') + describe MyClass do + context 'when foo' do + context 'when bar' do + context 'when baz' do + end + end + end + end + RUBY + + expect(cop.config_to_allow_offenses[:exclude_limit]).to eq('Max' => 4) + end + + it 'ignores non-spec context methods' do + expect_no_offenses(<<-RUBY) + class MyThingy + context 'this is not rspec' do + context 'but it uses contexts' do + end + end + end + RUBY + end + + context 'when Max is configured as 2' do + let(:cop_config) { { 'Max' => '2' } } + + it 'flags two levels of nesting' do + expect_offense(<<-RUBY) + describe MyClass do + context 'when foo' do + context 'when bar' do + ^^^^^^^^^^^^^^^^^^ Maximum example group nesting exceeded [3/2]. + context 'when baz' do + ^^^^^^^^^^^^^^^^^^ Maximum example group nesting exceeded [4/2]. + end + end + end + end + RUBY + end + end + + context 'when configured with MaxNesting' do + let(:cop_config) { { 'MaxNesting' => '1' } } + + it 'emits a deprecation warning' do + expect { inspect_source('describe(Foo) { }', 'foo_spec.rb') } + .to output( + 'Configuration key `MaxNesting` for RSpec/NestedGroups is ' \ + "deprecated in favor of `Max`. Please use that instead.\n" + ).to_stderr + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/not_to_not_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/not_to_not_spec.rb new file mode 100644 index 0000000000..42c4ce6a8f --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/not_to_not_spec.rb @@ -0,0 +1,87 @@ +RSpec.describe RuboCop::Cop::RSpec::NotToNot, :config do + subject(:cop) { described_class.new(config) } + + context 'when EnforcedStyle is `not_to`' do + let(:cop_config) { { 'EnforcedStyle' => 'not_to' } } + + it 'detects the `to_not` offense' do + expect_offense(<<-RUBY) + it { expect(false).to_not be_true } + ^^^^^^ Prefer `not_to` over `to_not`. + RUBY + end + + it 'detects the `to_not` offense on an expect block' do + expect_offense(<<-RUBY) + expect { + 2 + 2 + }.to_not raise_error + ^^^^^^ Prefer `not_to` over `to_not`. + RUBY + end + + it 'detects no offense when using `not_to`' do + expect_no_offenses(<<-RUBY) + it { expect(false).not_to be_true } + RUBY + end + + include_examples 'autocorrect', + 'it { expect(0).to_not equal 1 }', + 'it { expect(0).not_to equal 1 }' + + original = <<-RUBY + expect { + 2 + 2 + }.to_not raise_error + RUBY + corrected = <<-RUBY + expect { + 2 + 2 + }.not_to raise_error + RUBY + include_examples 'autocorrect', original, corrected + end + + context 'when AcceptedMethod is `to_not`' do + let(:cop_config) { { 'EnforcedStyle' => 'to_not' } } + + it 'detects the `not_to` offense' do + expect_offense(<<-RUBY) + it { expect(false).not_to be_true } + ^^^^^^ Prefer `to_not` over `not_to`. + RUBY + end + + it 'detects the `not_to` offense on an expect block' do + expect_offense(<<-RUBY) + expect { + 2 + 2 + }.not_to raise_error + ^^^^^^ Prefer `to_not` over `not_to`. + RUBY + end + + it 'detects no offense when using `to_not`' do + expect_no_offenses(<<-RUBY) + it { expect(false).to_not be_true } + RUBY + end + + include_examples 'autocorrect', + 'it { expect(0).not_to equal 1 }', + 'it { expect(0).to_not equal 1 }' + + original = <<-RUBY + expect { + 2 + 2 + }.not_to raise_error + RUBY + corrected = <<-RUBY + expect { + 2 + 2 + }.to_not raise_error + RUBY + include_examples 'autocorrect', original, corrected + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/overwriting_setup_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/overwriting_setup_spec.rb new file mode 100644 index 0000000000..2190aff4c5 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/overwriting_setup_spec.rb @@ -0,0 +1,89 @@ +RSpec.describe RuboCop::Cop::RSpec::OverwritingSetup do + subject(:cop) { described_class.new } + + it 'finds overwriten `let`' do + expect_offense(<<-RUBY) + RSpec.describe User do + let(:a) { a } + let(:a) { b } + ^^^^^^^^^^^^^ `a` is already defined. + end + RUBY + end + + it 'finds overwriten `subject`' do + expect_offense(<<-RUBY) + RSpec.describe User do + subject(:a) { a } + + let(:a) { b } + ^^^^^^^^^^^^^ `a` is already defined. + end + RUBY + end + + it 'works with `subject!` and `let!`' do + expect_offense(<<-RUBY) + RSpec.describe User do + subject!(:a) { a } + + let!(:a) { b } + ^^^^^^^^^^^^^^ `a` is already defined. + end + RUBY + end + + it 'finds `let!` overwriting `let`' do + expect_offense(<<-RUBY) + RSpec.describe User do + let(:a) { b } + let!(:a) { b } + ^^^^^^^^^^^^^^ `a` is already defined. + end + RUBY + end + + it 'ignores overwriting in different context' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + let(:a) { a } + + context `different` do + let(:a) { b } + end + end + RUBY + end + + it 'handles unnamed subjects' do + expect_offense(<<-RUBY) + RSpec.describe User do + subject { a } + + let(:subject) { b } + ^^^^^^^^^^^^^^^^^^^ `subject` is already defined. + end + RUBY + end + + it 'handles dynamic names for `let`' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + subject(:name) { a } + + let(name) { b } + end + RUBY + end + + it 'handles string arguments' do + expect_offense(<<-RUBY) + RSpec.describe User do + subject(:name) { a } + + let("name") { b } + ^^^^^^^^^^^^^^^^^ `name` is already defined. + end + RUBY + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/pending_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/pending_spec.rb new file mode 100644 index 0000000000..24d7640127 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/pending_spec.rb @@ -0,0 +1,176 @@ +RSpec.describe RuboCop::Cop::RSpec::Pending do + subject(:cop) { described_class.new } + + it 'flags xcontext' do + expect_offense(<<-RUBY) + xcontext 'test' do + ^^^^^^^^^^^^^^^ Pending spec found. + end + RUBY + end + + it 'flags xdescribe' do + expect_offense(<<-RUBY) + xdescribe 'test' do + ^^^^^^^^^^^^^^^^ Pending spec found. + end + RUBY + end + + it 'flags xexample' do + expect_offense(<<-RUBY) + xexample 'test' do + ^^^^^^^^^^^^^^^ Pending spec found. + end + RUBY + end + + it 'flags xfeature' do + expect_offense(<<-RUBY) + xfeature 'test' do + ^^^^^^^^^^^^^^^ Pending spec found. + end + RUBY + end + + it 'flags xit' do + expect_offense(<<-RUBY) + xit 'test' do + ^^^^^^^^^^ Pending spec found. + end + RUBY + end + + it 'flags xscenario' do + expect_offense(<<-RUBY) + xscenario 'test' do + ^^^^^^^^^^^^^^^^ Pending spec found. + end + RUBY + end + + it 'flags xspecify' do + expect_offense(<<-RUBY) + xspecify 'test' do + ^^^^^^^^^^^^^^^ Pending spec found. + end + RUBY + end + + it 'flags skip inside of an it' do + expect_offense(<<-RUBY) + it 'test' do + skip + ^^^^ Pending spec found. + end + RUBY + end + + it 'flags skip blocks' do + expect_offense(<<-RUBY) + skip 'test' do + ^^^^^^^^^^^ Pending spec found. + end + RUBY + end + + it 'flags blocks with skip symbol metadata' do + expect_offense(<<-RUBY) + it 'test', :skip do + ^^^^^^^^^^^^^^^^ Pending spec found. + end + RUBY + end + + it 'flags blocks with pending symbol metadata' do + expect_offense(<<-RUBY) + it 'test', :pending do + ^^^^^^^^^^^^^^^^^^^ Pending spec found. + end + RUBY + end + + it 'flags blocks with skip: true metadata' do + expect_offense(<<-RUBY) + it 'test', skip: true do + ^^^^^^^^^^^^^^^^^^^^^ Pending spec found. + end + RUBY + end + + it 'flags pending blocks' do + expect_offense(<<-RUBY) + pending 'test' do + ^^^^^^^^^^^^^^ Pending spec found. + end + RUBY + end + + it 'flags pending examples when receiver is explicit' do + expect_offense(<<-RUBY) + RSpec.xit 'test' do + ^^^^^^^^^^^^^^^^ Pending spec found. + end + RUBY + end + + it 'does not flag describe' do + expect_no_offenses(<<-RUBY) + describe 'test' do; end + RUBY + end + + it 'does not flag example' do + expect_no_offenses(<<-RUBY) + example 'test' do; end + RUBY + end + + it 'does not flag scenario' do + expect_no_offenses(<<-RUBY) + scenario 'test' do; end + RUBY + end + + it 'does not flag specify' do + expect_no_offenses(<<-RUBY) + specify 'test' do; end + RUBY + end + + it 'does not flag feature' do + expect_no_offenses(<<-RUBY) + feature 'test' do; end + RUBY + end + + it 'does not flag context' do + expect_no_offenses(<<-RUBY) + context 'test' do; end + RUBY + end + + it 'does not flag it' do + expect_no_offenses(<<-RUBY) + it 'test' do; end + RUBY + end + + it 'does not flag it with skip: false metadata' do + expect_no_offenses(<<-RUBY) + it 'test', skip: false do; end + RUBY + end + + it 'does not flag example_group' do + expect_no_offenses(<<-RUBY) + example_group 'test' do; end + RUBY + end + + it 'does not flag method called pending' do + expect_no_offenses(<<-RUBY) + subject { Project.pending } + RUBY + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/predicate_matcher_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/predicate_matcher_spec.rb new file mode 100644 index 0000000000..3a0acd2c2a --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/predicate_matcher_spec.rb @@ -0,0 +1,339 @@ +RSpec.describe RuboCop::Cop::RSpec::PredicateMatcher, :config do + subject(:cop) { described_class.new(config) } + + let(:cop_config) do + { 'EnforcedStyle' => enforced_style, + 'Strict' => strict } + end + + context 'when enforced style is `inflected`' do + let(:enforced_style) { 'inflected' } + + shared_examples 'inflected common' do + it 'registers an offense for a predicate method in actual' do + expect_offense(<<-RUBY) + expect(foo.empty?).to be_truthy + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `be_empty` matcher over `empty?`. + expect(foo.empty?).not_to be_truthy + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `be_empty` matcher over `empty?`. + expect(foo.empty?).to_not be_truthy + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `be_empty` matcher over `empty?`. + expect(foo.empty?).to be_falsey + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `be_empty` matcher over `empty?`. + expect(foo.has_something?).to be_truthy + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `have_something` matcher over `has_something?`. + expect(foo.include?(something)).to be_truthy + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `include` matcher over `include?`. + expect(foo.respond_to?(:bar)).to be_truthy + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `respond_to` matcher over `respond_to?`. + RUBY + end + + it 'registers an offense for a predicate method with argument' do + expect_offense(<<-RUBY) + expect(foo.something?('foo')).to be_truthy + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `be_something` matcher over `something?`. + expect(foo.something?('foo', 'bar')).to be_truthy + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `be_something` matcher over `something?`. + expect(foo.has_key?('foo')).to be_truthy + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `have_key` matcher over `has_key?`. + RUBY + end + + it 'registers an offense for a predicate method with a block' do + expect_offense(<<-RUBY) + expect(foo.all?(&:present?)).to be_truthy + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `be_all` matcher over `all?`. + expect(foo.all? { |x| x.present? }).to be_truthy + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `be_all` matcher over `all?`. + expect(foo.all? { present }).to be_truthy + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `be_all` matcher over `all?`. + expect(foo.something?(x) { |y| y.present? }).to be_truthy + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `be_something` matcher over `something?`. + RUBY + end + + it 'accepts a predicate method that is not ckeced true/false' do + expect_no_offenses(<<-RUBY) + expect(foo.something?).to eq "something" + expect(foo.has_something?).to eq "something" + RUBY + end + + it 'accepts non-predicate method' do + expect_no_offenses(<<-RUBY) + expect(foo.something).to be(true) + expect(foo.has_something).to be(true) + RUBY + end + + include_examples 'autocorrect', + 'expect(foo.empty?).to be_truthy', + 'expect(foo).to be_empty' + include_examples 'autocorrect', + 'expect(foo.empty?).not_to be_truthy', + 'expect(foo).not_to be_empty' + include_examples 'autocorrect', + 'expect(foo.empty?).to_not be_truthy', + 'expect(foo).not_to be_empty' + include_examples 'autocorrect', + 'expect(foo.empty?).to be_falsey', + 'expect(foo).not_to be_empty' + include_examples 'autocorrect', + 'expect(foo.empty?).not_to be_falsey', + 'expect(foo).to be_empty' + include_examples 'autocorrect', + 'expect(foo.empty?).not_to a_truthy_value', + 'expect(foo).not_to be_empty' + + include_examples 'autocorrect', + 'expect(foo.is_a?(Array)).to be_truthy', + 'expect(foo).to be_a(Array)' + + include_examples 'autocorrect', + 'expect(foo.instance_of?(Array)).to be_truthy', + 'expect(foo).to be_an_instance_of(Array)' + + include_examples 'autocorrect', + 'expect(foo.has_something?).to be_truthy', + 'expect(foo).to have_something' + include_examples 'autocorrect', + 'expect(foo.has_something?).not_to be_truthy', + 'expect(foo).not_to have_something' + include_examples 'autocorrect', + 'expect(foo.include?(something)).to be_truthy', + 'expect(foo).to include(something)' + include_examples 'autocorrect', + 'expect(foo.respond_to?(:bar)).to be_truthy', + 'expect(foo).to respond_to(:bar)' + + include_examples 'autocorrect', + 'expect(foo.something?()).to be_truthy', + 'expect(foo).to be_something()' + include_examples 'autocorrect', + 'expect(foo.something? 1, 2).to be_truthy', + 'expect(foo).to be_something 1, 2' + include_examples 'autocorrect', + 'expect(foo.has_key?("foo")).to be_truthy', + 'expect(foo).to have_key("foo")' + include_examples 'autocorrect', + 'expect(foo.something?(1, 2)).to be_truthy', + 'expect(foo).to be_something(1, 2)' + + include_examples 'autocorrect', + 'expect(foo.all? { |x| x.present? }).to be_truthy', + 'expect(foo).to be_all { |x| x.present? }' + include_examples 'autocorrect', + 'expect(foo.all?(n) { |x| x.present? }).to be_truthy', + 'expect(foo).to be_all(n) { |x| x.present? }' + include_examples 'autocorrect', + 'expect(foo.all? { present }).to be_truthy', + 'expect(foo).to be_all { present }' + include_examples 'autocorrect', + 'expect(foo.all? { }).to be_truthy', + 'expect(foo).to be_all { }' + include_examples 'autocorrect', + <<-BEFORE, <<-AFTER + expect(foo.all? do |x| + x + 1 + x >= 2 + end).to be_truthy + BEFORE + expect(foo).to be_all do |x| + x + 1 + x >= 2 + end + AFTER + include_examples 'autocorrect', + 'expect(foo.all? do; end).to be_truthy', + 'expect(foo).to be_all do; end' + end + + context 'when strict is true' do + let(:strict) { true } + + include_examples 'inflected common' + + it 'accepts strict checking boolean matcher' do + expect_no_offenses(<<-RUBY) + expect(foo.empty?).to eq(true) + expect(foo.empty?).to be(true) + expect(foo.empty?).to be(false) + expect(foo.empty?).not_to be true + expect(foo.empty?).not_to be false + RUBY + end + end + + context 'when strict is false' do + let(:strict) { false } + + include_examples 'inflected common' + + it 'registers an offense for a predicate method in actual' do + expect_offense(<<-RUBY) + expect(foo.empty?).to eq(true) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `be_empty` matcher over `empty?`. + expect(foo.empty?).to be(true) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `be_empty` matcher over `empty?`. + expect(foo.empty?).to be(false) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `be_empty` matcher over `empty?`. + expect(foo.empty?).not_to be true + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `be_empty` matcher over `empty?`. + expect(foo.empty?).not_to be false + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `be_empty` matcher over `empty?`. + RUBY + end + + include_examples 'autocorrect', + 'expect(foo.empty?).to eq(true)', + 'expect(foo).to be_empty' + include_examples 'autocorrect', + 'expect(foo.empty?).to eq(false)', + 'expect(foo).not_to be_empty' + include_examples 'autocorrect', + 'expect(foo.empty?).to be(true)', + 'expect(foo).to be_empty' + include_examples 'autocorrect', + 'expect(foo.empty?).to be(false)', + 'expect(foo).not_to be_empty' + include_examples 'autocorrect', + 'expect(foo.empty?).not_to be(true)', + 'expect(foo).not_to be_empty' + include_examples 'autocorrect', + 'expect(foo.empty?).not_to be(false)', + 'expect(foo).to be_empty' + end + end + + context 'when enforced style is `explicit`' do + let(:enforced_style) { 'explicit' } + + shared_examples 'explicit common' do + it 'registers an offense for a predicate mather' do + expect_offense(<<-RUBY) + expect(foo).to be_empty + ^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `empty?` over `be_empty` matcher. + expect(foo).not_to be_empty + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `empty?` over `be_empty` matcher. + expect(foo).to have_something + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `has_something?` over `have_something` matcher. + RUBY + end + + it 'registers an offense for a predicate mather with argument' do + expect_offense(<<-RUBY) + expect(foo).to be_something(1, 2) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `something?` over `be_something` matcher. + expect(foo).to have_key(1) + ^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `has_key?` over `have_key` matcher. + RUBY + end + + it 'registers an offense for a predicate matcher with a block' do + expect_offense(<<-RUBY) + expect(foo).to be_all(&:present?) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `all?` over `be_all` matcher. + expect(foo).to be_all { |x| x.present? } + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `all?` over `be_all` matcher. + expect(foo).to be_all { present } + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `all?` over `be_all` matcher. + expect(foo).to be_something(x) { |y| y.present? } + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using `something?` over `be_something` matcher. + RUBY + end + + it 'accepts built in matchers' do + expect_no_offenses(<<-RUBY) + expect(foo).to be_truthy + expect(foo).to be_falsey + expect(foo).to be_falsy + expect(foo).to have_attributes(name: 'foo') + expect(foo).to have_received(:foo) + expect(foo).to be_between(1, 10) + expect(foo).to be_within(0.1).of(10.0) + RUBY + end + + it 'accepts non-predicate matcher' do + expect_no_offenses(<<-RUBY) + expect(foo).to be(true) + RUBY + end + end + + shared_examples 'explicit autocorrect' do |matcher_true, matcher_false| + include_examples 'autocorrect', + 'expect(foo).to be_something', + "expect(foo.something?).to #{matcher_true}" + include_examples 'autocorrect', + 'expect(foo).not_to be_something', + "expect(foo.something?).to #{matcher_false}" + include_examples 'autocorrect', + 'expect(foo).to have_something', + "expect(foo.has_something?).to #{matcher_true}" + + include_examples 'autocorrect', + 'expect(foo).to be_a(Array)', + "expect(foo.is_a?(Array)).to #{matcher_true}" + include_examples 'autocorrect', + 'expect(foo).to be_instance_of(Array)', + "expect(foo.instance_of?(Array)).to #{matcher_true}" + + include_examples 'autocorrect', + 'expect(foo).to be_something()', + "expect(foo.something?()).to #{matcher_true}" + include_examples 'autocorrect', + 'expect(foo).to be_something(1)', + "expect(foo.something?(1)).to #{matcher_true}" + include_examples 'autocorrect', + 'expect(foo).to be_something(1, 2)', + "expect(foo.something?(1, 2)).to #{matcher_true}" + include_examples 'autocorrect', + 'expect(foo).to be_something 1, 2', + "expect(foo.something? 1, 2).to #{matcher_true}" + + include_examples 'autocorrect', + 'expect(foo).to be_all { |x| x.present? }', + "expect(foo.all? { |x| x.present? }).to #{matcher_true}" + include_examples 'autocorrect', + 'expect(foo).to be_all(n) { |x| x.ok? }', + "expect(foo.all?(n) { |x| x.ok? }).to #{matcher_true}" + include_examples 'autocorrect', + 'expect(foo).to be_all { present }', + "expect(foo.all? { present }).to #{matcher_true}" + include_examples 'autocorrect', + 'expect(foo).to be_all { }', + "expect(foo.all? { }).to #{matcher_true}" + include_examples 'autocorrect', + <<-BEFORE, <<-AFTER + expect(foo).to be_all do |x| + x + 1 + x >= 2 + end + BEFORE + expect(foo.all? do |x| + x + 1 + x >= 2 + end).to #{matcher_true} + AFTER + include_examples 'autocorrect', + 'expect(foo).to be_all do; end', + "expect(foo.all? do; end).to #{matcher_true}" + end + + context 'when strict is true' do + let(:strict) { true } + + include_examples 'explicit common' + include_examples 'explicit autocorrect', 'be(true)', 'be(false)' + end + + context 'when strict is false' do + let(:strict) { false } + + include_examples 'explicit common' + include_examples 'explicit autocorrect', 'be_truthy', 'be_falsey' + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/rails/http_status_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/rails/http_status_spec.rb new file mode 100644 index 0000000000..2ce038ffa2 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/rails/http_status_spec.rb @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +RSpec.describe RuboCop::Cop::RSpec::Rails::HttpStatus, :config do + subject(:cop) { described_class.new(config) } + + context 'when EnforcedStyle is `symbolic`' do + let(:cop_config) { { 'EnforcedStyle' => 'symbolic' } } + + it 'registers an offense when using numeric value' do + expect_offense(<<-RUBY) + it { is_expected.to have_http_status 200 } + ^^^ Prefer `:ok` over `200` to describe HTTP status code. + RUBY + end + + it 'does not register an offense when using symbolic value' do + expect_no_offenses(<<-RUBY) + it { is_expected.to have_http_status :ok } + RUBY + end + + it 'does not register an offense when using custom HTTP code' do + expect_no_offenses(<<-RUBY) + it { is_expected.to have_http_status 550 } + RUBY + end + + include_examples 'autocorrect', + 'it { is_expected.to have_http_status 200 }', + 'it { is_expected.to have_http_status :ok }' + + include_examples 'autocorrect', + 'it { is_expected.to have_http_status 404 }', + 'it { is_expected.to have_http_status :not_found }' + + context 'with parenthesis' do + include_examples 'autocorrect', + 'it { is_expected.to have_http_status(200) }', + 'it { is_expected.to have_http_status(:ok) }' + + include_examples 'autocorrect', + 'it { is_expected.to have_http_status(404) }', + 'it { is_expected.to have_http_status(:not_found) }' + end + end + + context 'when EnforcedStyle is `numeric`' do + let(:cop_config) { { 'EnforcedStyle' => 'numeric' } } + + it 'registers an offense when using symbolic value' do + expect_offense(<<-RUBY) + it { is_expected.to have_http_status :ok } + ^^^ Prefer `200` over `:ok` to describe HTTP status code. + RUBY + end + + it 'does not register an offense when using numeric value' do + expect_no_offenses(<<-RUBY) + it { is_expected.to have_http_status 200 } + RUBY + end + + it 'does not register an offense when using whitelisted symbols' do + expect_no_offenses(<<-RUBY) + it { is_expected.to have_http_status :error } + it { is_expected.to have_http_status :success } + it { is_expected.to have_http_status :missing } + it { is_expected.to have_http_status :redirect } + RUBY + end + + include_examples 'autocorrect', + 'it { is_expected.to have_http_status :ok }', + 'it { is_expected.to have_http_status 200 }' + + include_examples 'autocorrect', + 'it { is_expected.to have_http_status :not_found }', + 'it { is_expected.to have_http_status 404 }' + + context 'with parenthesis' do + include_examples 'autocorrect', + 'it { is_expected.to have_http_status(:ok) }', + 'it { is_expected.to have_http_status(200) }' + + include_examples 'autocorrect', + 'it { is_expected.to have_http_status(:not_found) }', + 'it { is_expected.to have_http_status(404) }' + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/receive_counts_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/receive_counts_spec.rb new file mode 100644 index 0000000000..b190917ace --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/receive_counts_spec.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +RSpec.describe RuboCop::Cop::RSpec::ReceiveCounts do + subject(:cop) { described_class.new } + + it 'flags usage of `exactly(1).times`' do + expect_offense(<<-RUBY) + expect(foo).to receive(:bar).exactly(1).times + ^^^^^^^^^^^^^^^^^ Use `.once` instead of `.exactly(1).times`. + RUBY + end + + it 'flags usage of `exactly(2).times`' do + expect_offense(<<-RUBY) + expect(foo).to receive(:bar).exactly(2).times + ^^^^^^^^^^^^^^^^^ Use `.twice` instead of `.exactly(2).times`. + RUBY + end + + it 'allows `exactly(3).times`' do + expect_no_offenses(<<-RUBY) + expect(foo).to receive(:bar).exactly(3).times + RUBY + end + + it 'allows `exactly(n).times`' do + expect_no_offenses(<<-RUBY) + expect(foo).to receive(:bar).exactly(n).times + RUBY + end + + it 'flags usage of `exactly(1).times` after `with`' do + expect_offense(<<-RUBY) + expect(foo).to receive(:bar).with(baz).exactly(1).times + ^^^^^^^^^^^^^^^^^ Use `.once` instead of `.exactly(1).times`. + RUBY + end + + it 'flags usage of `exactly(1).times` with return value' do + expect_offense(<<-RUBY) + expect(foo).to receive(:bar).exactly(1).times.and_return(true) + ^^^^^^^^^^^^^^^^^ Use `.once` instead of `.exactly(1).times`. + RUBY + end + + it 'flags usage of `exactly(1).times` with a block' do + expect_offense(<<-RUBY) + expect(foo).to receive(:bar).exactly(1).times { true } + ^^^^^^^^^^^^^^^^^ Use `.once` instead of `.exactly(1).times`. + RUBY + end + + it 'flags usage of `at_least(1).times`' do + expect_offense(<<-RUBY) + expect(foo).to receive(:bar).at_least(1).times + ^^^^^^^^^^^^^^^^^^ Use `.at_least(:once)` instead of `.at_least(1).times`. + RUBY + end + + it 'flags usage of `at_least(2).times`' do + expect_offense(<<-RUBY) + expect(foo).to receive(:bar).at_least(2).times + ^^^^^^^^^^^^^^^^^^ Use `.at_least(:twice)` instead of `.at_least(2).times`. + RUBY + end + + it 'flags usage of `at_most(1).times`' do + expect_offense(<<-RUBY) + expect(foo).to receive(:bar).at_most(1).times + ^^^^^^^^^^^^^^^^^ Use `.at_most(:once)` instead of `.at_most(1).times`. + RUBY + end + + it 'flags usage of `at_most(2).times`' do + expect_offense(<<-RUBY) + expect(foo).to receive(:bar).at_most(2).times + ^^^^^^^^^^^^^^^^^ Use `.at_most(:twice)` instead of `.at_most(2).times`. + RUBY + end + + include_examples 'autocorrect', + 'expect(foo).to receive(:bar).exactly(1).times { true }', + 'expect(foo).to receive(:bar).once { true }' + + include_examples 'autocorrect', + 'expect(foo).to receive(:bar).at_least(2).times { true }', + 'expect(foo).to receive(:bar).at_least(:twice) { true }' +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/receive_never_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/receive_never_spec.rb new file mode 100644 index 0000000000..dfa41690d2 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/receive_never_spec.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +RSpec.describe RuboCop::Cop::RSpec::ReceiveNever do + subject(:cop) { described_class.new } + + it 'flags usage of `never`' do + expect_offense(<<-RUBY) + expect(foo).to receive(:bar).never + ^^^^^ Use `not_to receive` instead of `never`. + RUBY + end + + it 'flags usage of `never` after `with`' do + expect_offense(<<-RUBY) + expect(foo).to receive(:bar).with(baz).never + ^^^^^ Use `not_to receive` instead of `never`. + RUBY + end + + it 'flags usage of `never` with `is_expected`' do + expect_offense(<<-RUBY) + is_expected.to receive(:bar).with(baz).never + ^^^^^ Use `not_to receive` instead of `never`. + RUBY + end + + it 'flags usage of `never` with `expect_any_instance_of`' do + expect_offense(<<-RUBY) + expect_any_instance_of(Foo).to receive(:bar).with(baz).never + ^^^^^ Use `not_to receive` instead of `never`. + RUBY + end + + it 'allows method called `never`' do + expect_no_offenses(<<-RUBY) + expect(foo).to receive(:bar).with(Value.never) + expect(foo.never).to eq(bar.never) + is_expected.to be never + RUBY + end + + include_examples 'autocorrect', + 'expect(foo).to receive(:bar).with(0).never', + 'expect(foo).not_to receive(:bar).with(0)' +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/repeated_description_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/repeated_description_spec.rb new file mode 100644 index 0000000000..b696d94b16 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/repeated_description_spec.rb @@ -0,0 +1,76 @@ +# frozen_string_literal: true + +RSpec.describe RuboCop::Cop::RSpec::RepeatedDescription do + subject(:cop) { described_class.new } + + it 'registers an offense for repeated descriptions' do + expect_offense(<<-RUBY) + describe 'doing x' do + it "does x" do + ^^^^^^^^^^^ Don't repeat descriptions within an example group. + end + + it "does x" do + ^^^^^^^^^^^ Don't repeat descriptions within an example group. + end + end + RUBY + end + + it 'registers offense for repeated descriptions separated by a context' do + expect_offense(<<-RUBY) + describe 'doing x' do + it "does x" do + ^^^^^^^^^^^ Don't repeat descriptions within an example group. + end + + context 'during some use case' do + it "does x" do + # this should be fine + end + end + + it "does x" do + ^^^^^^^^^^^ Don't repeat descriptions within an example group. + end + end + RUBY + end + + it 'ignores descriptions repeated in a shared context' do + expect_no_offenses(<<-RUBY) + describe 'doing x' do + it "does x" do + end + + shared_context 'shared behavior' do + it "does x" do + end + end + end + RUBY + end + + it 'ignores repeated descriptions in a nested context' do + expect_no_offenses(<<-RUBY) + describe 'doing x' do + it "does x" do + end + + context 'in a certain use case' do + it "does x" do + end + end + end + RUBY + end + + it 'does not flag tests which do not contain description strings' do + expect_no_offenses(<<-RUBY) + describe 'doing x' do + it { foo } + it { bar } + end + RUBY + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/repeated_example_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/repeated_example_spec.rb new file mode 100644 index 0000000000..879677070c --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/repeated_example_spec.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +RSpec.describe RuboCop::Cop::RSpec::RepeatedExample do + subject(:cop) { described_class.new } + + it 'registers an offense for repeated example' do + expect_offense(<<-RUBY) + describe 'doing x' do + it "does x" do + ^^^^^^^^^^^^^^ Don't repeat examples within an example group. + expect(foo).to be(bar) + end + + it "does y" do + ^^^^^^^^^^^^^^ Don't repeat examples within an example group. + expect(foo).to be(bar) + end + end + RUBY + end + + it 'does not register a violation if rspec tag magic is involved' do + expect_no_offenses(<<-RUBY) + describe 'doing x' do + it "does x" do + expect(foo).to be(bar) + end + + it "does y", :focus do + expect(foo).to be(bar) + end + end + RUBY + end + + it 'does not flag examples with different implementations' do + expect_no_offenses(<<-RUBY) + describe 'doing x' do + it "does x" do + expect(foo).to have_attribute(foo: 1) + end + + it "does y" do + expect(foo).to have_attribute(bar: 2) + end + end + RUBY + end + + it 'does not flag examples when different its arguments are used' do + expect_no_offenses(<<-RUBY) + describe 'doing x' do + its(:x) { is_expected.to be_present } + its(:y) { is_expected.to be_present } + end + RUBY + end + + it 'does not flag repeated examples in different scopes' do + expect_no_offenses(<<-RUBY) + describe 'doing x' do + it "does x" do + expect(foo).to be(bar) + end + + context 'when the scope changes' do + it 'does not flag anything' do + expect(foo).to be(bar) + end + end + end + RUBY + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/return_from_stub_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/return_from_stub_spec.rb new file mode 100644 index 0000000000..515dc88051 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/return_from_stub_spec.rb @@ -0,0 +1,266 @@ +RSpec.describe RuboCop::Cop::RSpec::ReturnFromStub, :config do + subject(:cop) { described_class.new(config) } + + let(:cop_config) do + { 'EnforcedStyle' => enforced_style } + end + + context 'with EnforcedStyle `and_return`' do + let(:enforced_style) { 'and_return' } + + it 'finds static values returned from block' do + expect_offense(<<-RUBY) + it do + allow(Foo).to receive(:bar) { 42 } + ^ Use `and_return` for static values. + end + RUBY + end + + it 'finds empty values returned from block' do + expect_offense(<<-RUBY) + it do + allow(Foo).to receive(:bar) {} + ^ Use `and_return` for static values. + end + RUBY + end + + it 'finds array with only static values returned from block' do + expect_offense(<<-RUBY) + it do + allow(Foo).to receive(:bar) { [42, 43] } + ^ Use `and_return` for static values. + end + RUBY + end + + it 'finds hash with only static values returned from block' do + expect_offense(<<-RUBY) + it do + allow(Foo).to receive(:bar) { {a: 42, b: 43} } + ^ Use `and_return` for static values. + end + RUBY + end + + it 'finds static values in a block when there are chained methods' do + expect_offense(<<-RUBY) + it do + allow(Question).to receive(:meaning).with(:universe) { 42 } + ^ Use `and_return` for static values. + end + RUBY + end + + it 'finds constants returned from block' do + expect_offense(<<-RUBY) + it do + allow(Foo).to receive(:bar) { Life::MEANING } + ^ Use `and_return` for static values. + end + RUBY + end + + it 'finds nested constants returned from block' do + expect_offense(<<-RUBY) + it do + allow(Foo).to receive(:bar) { {Life::MEANING => 42} } + ^ Use `and_return` for static values. + end + RUBY + end + + it 'ignores dynamic values returned from block' do + expect_no_offenses(<<-RUBY) + it do + allow(Foo).to receive(:bar) { baz } + end + RUBY + end + + it 'ignores variables return from block' do + expect_no_offenses(<<-RUBY) + it do + $bar = 42 + baz = 123 + allow(Foo).to receive(:bar) { $bar } + allow(Foo).to receive(:baz) { baz } + end + RUBY + end + + it 'ignores array with dynamic values returned from block' do + expect_no_offenses(<<-RUBY) + it do + allow(Foo).to receive(:bar) { [42, baz] } + end + RUBY + end + + it 'ignores hash with dynamic values returned from block' do + expect_no_offenses(<<-RUBY) + it do + allow(Foo).to receive(:bar) { {a: 42, b: baz} } + end + RUBY + end + + it 'ignores block returning string with interpolation' do + expect_no_offenses(<<-RUBY) + it do + bar = 42 + allow(Foo).to receive(:bar) { "You called \#{bar}" } + end + RUBY + end + + it 'finds concatenated strings with no variables' do + expect_offense(<<-RUBY) + it do + allow(Foo).to receive(:bar) do + ^^ Use `and_return` for static values. + "You called" \ + "me" + end + end + RUBY + end + + it 'ignores stubs without return value' do + expect_no_offenses(<<-RUBY) + it do + allow(Foo).to receive(:bar) + end + RUBY + end + + it 'handles stubs in a method' do + expect_no_offenses(<<-RUBY) + def stub_foo + allow(Foo).to receive(:bar) + end + RUBY + end + + include_examples 'autocorrect', + 'allow(Foo).to receive(:bar) { 42 }', + 'allow(Foo).to receive(:bar).and_return(42)' + + include_examples 'autocorrect', + 'allow(Foo).to receive(:bar) { { foo: 42 } }', + 'allow(Foo).to receive(:bar).and_return({ foo: 42 })' + + include_examples 'autocorrect', + 'allow(Foo).to receive(:bar).with(1) { 42 }', + 'allow(Foo).to receive(:bar).with(1).and_return(42)' + + include_examples 'autocorrect', + 'allow(Foo).to receive(:bar) {}', + 'allow(Foo).to receive(:bar).and_return(nil)' + + original = <<-RUBY + allow(Foo).to receive(:bar) do + 'You called ' \\ + 'me' + end + RUBY + corrected = <<-RUBY + allow(Foo).to receive(:bar).and_return('You called ' \\ + 'me') + RUBY + + include_examples 'autocorrect', original, corrected + end + + context 'with EnforcedStyle `block`' do + let(:enforced_style) { 'block' } + + it 'finds static values returned from method' do + expect_offense(<<-RUBY) + it do + allow(Foo).to receive(:bar).and_return(42) + ^^^^^^^^^^ Use block for static values. + end + RUBY + end + + it 'finds static values returned from chained method' do + expect_offense(<<-RUBY) + it do + allow(Foo).to receive(:bar).with(1).and_return(42) + ^^^^^^^^^^ Use block for static values. + end + RUBY + end + + it 'ignores dynamic values returned from method' do + expect_no_offenses(<<-RUBY) + it do + allow(Foo).to receive(:bar).and_return(baz) + end + RUBY + end + + it 'ignores string with interpolation returned from method' do + expect_no_offenses(<<-RUBY) + it do + bar = 42 + allow(Foo).to receive(:bar).and_return("You called \#{bar}") + end + RUBY + end + + it 'ignores multiple values being returned from method' do + expect_no_offenses(<<-RUBY) + it do + allow(Foo).to receive(:bar).and_return(42, 43, 44) + end + RUBY + end + + include_examples 'autocorrect', + 'allow(Foo).to receive(:bar).and_return(42)', + 'allow(Foo).to receive(:bar) { 42 }' + + include_examples 'autocorrect', + 'allow(Foo).to receive(:bar).with(1).and_return(foo: 42)', + 'allow(Foo).to receive(:bar).with(1) { { foo: 42 } }' + + include_examples 'autocorrect', + 'allow(Foo).to receive(:bar).and_return({ foo: 42 })', + 'allow(Foo).to receive(:bar) { { foo: 42 } }' + + include_examples 'autocorrect', + 'allow(Foo).to receive(:bar).and_return(foo: 42)', + 'allow(Foo).to receive(:bar) { { foo: 42 } }' + + original = <<-RUBY + allow(Foo).to receive(:bar).and_return( + a: 42, + b: 43 + ) + RUBY + corrected = <<-RUBY # Not perfect, but good enough. + allow(Foo).to receive(:bar) { { a: 42, + b: 43 } } + RUBY + + include_examples 'autocorrect', original, corrected + + include_examples 'autocorrect', + 'allow(Foo).to receive(:bar).and_return(nil)', + 'allow(Foo).to receive(:bar) { nil }' + + original = <<-RUBY + allow(Foo).to receive(:bar).and_return('You called ' \\ + 'me') + RUBY + corrected = <<-RUBY + allow(Foo).to receive(:bar) { 'You called ' \\ + 'me' } + RUBY + + include_examples 'autocorrect', original, corrected + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/scattered_let_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/scattered_let_spec.rb new file mode 100644 index 0000000000..9080158b3a --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/scattered_let_spec.rb @@ -0,0 +1,26 @@ +RSpec.describe RuboCop::Cop::RSpec::ScatteredLet do + subject(:cop) { described_class.new } + + it 'flags `let` after the first different node ' do + expect_offense(<<-RUBY) + RSpec.describe User do + let(:a) { a } + subject { User } + let(:b) { b } + ^^^^^^^^^^^^^ Group all let/let! blocks in the example group together. + end + RUBY + end + + it 'doesnt flag `let!` in the middle of multiple `let`s' do + expect_no_offenses(<<-RUBY) + RSpec.describe User do + subject { User } + + let(:a) { a } + let!(:b) { b } + let(:c) { c } + end + RUBY + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/scattered_setup_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/scattered_setup_spec.rb new file mode 100644 index 0000000000..aee5182e10 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/scattered_setup_spec.rb @@ -0,0 +1,96 @@ +RSpec.describe RuboCop::Cop::RSpec::ScatteredSetup do + subject(:cop) { described_class.new } + + it 'flags multiple hooks in the same example group' do + expect_offense(<<-RUBY) + describe Foo do + before { bar } + ^^^^^^^^^^^^^^ Do not define multiple hooks in the same example group. + before { baz } + ^^^^^^^^^^^^^^ Do not define multiple hooks in the same example group. + end + RUBY + end + + it 'flags multiple hooks of the same scope with different symbols' do + expect_offense(<<-RUBY) + describe Foo do + before { bar } + ^^^^^^^^^^^^^^ Do not define multiple hooks in the same example group. + before(:each) { baz } + ^^^^^^^^^^^^^^^^^^^^^ Do not define multiple hooks in the same example group. + before(:example) { baz } + ^^^^^^^^^^^^^^^^^^^^^^^^ Do not define multiple hooks in the same example group. + end + RUBY + end + + it 'flags multiple before(:all) hooks in the same example group' do + expect_offense(<<-RUBY) + describe Foo do + before(:all) { bar } + ^^^^^^^^^^^^^^^^^^^^ Do not define multiple hooks in the same example group. + before(:all) { baz } + ^^^^^^^^^^^^^^^^^^^^ Do not define multiple hooks in the same example group. + end + RUBY + end + + it 'does not flag different hooks' do + expect_no_offenses(<<-RUBY) + describe Foo do + before { bar } + after { baz } + around { qux } + end + RUBY + end + + it 'does not flag different hook types' do + expect_no_offenses(<<-RUBY) + describe Foo do + before { bar } + before(:all) { baz } + before(:suite) { baz } + end + RUBY + end + + it 'does not flag hooks in different example groups' do + expect_no_offenses(<<-RUBY) + describe Foo do + before { bar } + + describe '.baz' do + before { baz } + end + end + RUBY + end + + it 'does not flag hooks in different shared contexts' do + expect_no_offenses(<<-RUBY) + describe Foo do + shared_context 'one' do + before { bar } + end + + shared_context 'two' do + before { baz } + end + end + RUBY + end + + it 'does not flag similar method names inside of examples' do + expect_no_offenses(<<-RUBY) + describe Foo do + before { bar } + + it 'uses an instance method called before' do + expect(before { tricky }).to_not confuse_rubocop_rspec + end + end + RUBY + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/shared_context_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/shared_context_spec.rb new file mode 100644 index 0000000000..fe45a8a0d7 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/shared_context_spec.rb @@ -0,0 +1,142 @@ +RSpec.describe RuboCop::Cop::RSpec::SharedContext do + subject(:cop) { described_class.new } + + describe 'shared_context' do + it 'does not register an offense for empty contexts' do + expect_no_offenses(<<-RUBY) + shared_context 'empty' do + end + RUBY + end + + it 'registers an offense for shared_context with only examples' do + expect_offense(<<-RUBY) + shared_context 'foo' do + ^^^^^^^^^^^^^^^^^^^^ Use `shared_examples` when you don't define context. + it 'performs actions' do + end + end + RUBY + end + + it 'does not register an offense for `shared_context` with let' do + expect_no_offenses(<<-RUBY) + shared_context 'foo' do + let(:foo) { :bar } + + it 'performs actions' do + end + end + RUBY + end + + it 'does not register an offense for `shared_context` with subject' do + expect_no_offenses(<<-RUBY) + shared_context 'foo' do + subject(:foo) { :bar } + + it 'performs actions' do + end + end + RUBY + end + + it 'does not register an offense for `shared_context` with before' do + expect_no_offenses(<<-RUBY) + shared_context 'foo' do + before do + something + end + + it 'performs actions' do + end + end + RUBY + end + end + + describe 'shared_examples' do + it 'does not register an offense for empty examples' do + expect_no_offenses(<<-RUBY) + shared_examples 'empty' do + end + RUBY + end + + it 'registers an offense for shared_examples with only let' do + expect_offense(<<-RUBY) + shared_examples 'foo' do + ^^^^^^^^^^^^^^^^^^^^^ Use `shared_context` when you don't define examples. + let(:foo) { :bar } + end + RUBY + end + + it 'registers an offense for shared_examples with only subject' do + expect_offense(<<-RUBY) + shared_examples 'foo' do + ^^^^^^^^^^^^^^^^^^^^^ Use `shared_context` when you don't define examples. + subject(:foo) { :bar } + end + RUBY + end + + it 'registers an offense for shared_examples with only hooks' do + expect_offense(<<-RUBY) + shared_examples 'foo' do + ^^^^^^^^^^^^^^^^^^^^^ Use `shared_context` when you don't define examples. + before do + foo + end + end + RUBY + end + + it 'does not register an offense for `shared_examples` with it' do + expect_no_offenses(<<-RUBY) + shared_examples 'foo' do + subject(:foo) { 'foo' } + let(:bar) { :baz } + before { initialize } + + it 'works' do + end + end + RUBY + end + end + + bad_shared_context = <<-RUBY + shared_context 'foo' do + it 'performs actions' do + end + end + RUBY + + good_shared_context = <<-RUBY + shared_examples 'foo' do + it 'performs actions' do + end + end + RUBY + + include_examples 'autocorrect', + bad_shared_context, + good_shared_context + + bad_shared_examples = <<-RUBY + shared_examples 'foo' do + let(:foo) { :bar } + end + RUBY + + good_shared_examples = <<-RUBY + shared_context 'foo' do + let(:foo) { :bar } + end + RUBY + + include_examples 'autocorrect', + bad_shared_examples, + good_shared_examples +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/shared_examples_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/shared_examples_spec.rb new file mode 100644 index 0000000000..586e803ef6 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/shared_examples_spec.rb @@ -0,0 +1,93 @@ +# frozen_string_literal: true + +RSpec.describe RuboCop::Cop::RSpec::SharedExamples do + subject(:cop) { described_class.new } + + it 'registers an offense when using symbolic title' do + expect_offense(<<-RUBY) + it_behaves_like :foo_bar_baz + ^^^^^^^^^^^^ Prefer 'foo bar baz' over `:foo_bar_baz` to titleize shared examples. + it_should_behave_like :foo_bar_baz + ^^^^^^^^^^^^ Prefer 'foo bar baz' over `:foo_bar_baz` to titleize shared examples. + shared_examples :foo_bar_baz + ^^^^^^^^^^^^ Prefer 'foo bar baz' over `:foo_bar_baz` to titleize shared examples. + shared_examples_for :foo_bar_baz + ^^^^^^^^^^^^ Prefer 'foo bar baz' over `:foo_bar_baz` to titleize shared examples. + include_examples :foo_bar_baz + ^^^^^^^^^^^^ Prefer 'foo bar baz' over `:foo_bar_baz` to titleize shared examples. + include_examples :foo_bar_baz, 'foo', 'bar' + ^^^^^^^^^^^^ Prefer 'foo bar baz' over `:foo_bar_baz` to titleize shared examples. + + shared_examples :foo_bar_baz do |param| + ^^^^^^^^^^^^ Prefer 'foo bar baz' over `:foo_bar_baz` to titleize shared examples. + # ... + end + + RSpec.shared_examples :foo_bar_baz + ^^^^^^^^^^^^ Prefer 'foo bar baz' over `:foo_bar_baz` to titleize shared examples. + RUBY + end + + it 'does not register an offense when using string title' do + expect_no_offenses(<<-RUBY) + it_behaves_like 'foo bar baz' + it_should_behave_like 'foo bar baz' + shared_examples 'foo bar baz' + shared_examples_for 'foo bar baz' + include_examples 'foo bar baz' + include_examples 'foo bar baz', 'foo', 'bar' + + shared_examples 'foo bar baz', 'foo', 'bar' do |param| + # ... + end + RUBY + end + + it 'does not register an offense when using Module/Class title' do + expect_no_offenses(<<-RUBY) + it_behaves_like FooBarBaz + it_should_behave_like FooBarBaz + shared_examples FooBarBaz + shared_examples_for FooBarBaz + include_examples FooBarBaz + include_examples FooBarBaz, 'foo', 'bar' + + shared_examples FooBarBaz, 'foo', 'bar' do |param| + # ... + end + RUBY + end + + include_examples 'autocorrect', + 'it_behaves_like :foo_bar_baz', + "it_behaves_like 'foo bar baz'" + include_examples 'autocorrect', + 'it_should_behave_like :foo_bar_baz', + "it_should_behave_like 'foo bar baz'" + include_examples 'autocorrect', + 'shared_examples :foo_bar_baz', + "shared_examples 'foo bar baz'" + include_examples 'autocorrect', + 'shared_examples_for :foo_bar_baz', + "shared_examples_for 'foo bar baz'" + include_examples 'autocorrect', + 'include_examples :foo_bar_baz', + "include_examples 'foo bar baz'" + include_examples 'autocorrect', + "include_examples :foo_bar_baz, 'foo', 'bar'", + "include_examples 'foo bar baz', 'foo', 'bar'" + + bad_code_with_block = <<-RUBY + shared_examples :foo_bar_baz, 'foo', 'bar' do |param| + # ... + end + RUBY + + good_code_with_block = <<-RUBY + shared_examples 'foo bar baz', 'foo', 'bar' do |param| + # ... + end + RUBY + + include_examples 'autocorrect', bad_code_with_block, good_code_with_block +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/single_argument_message_chain_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/single_argument_message_chain_spec.rb new file mode 100644 index 0000000000..b4773f25fc --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/single_argument_message_chain_spec.rb @@ -0,0 +1,138 @@ +RSpec.describe RuboCop::Cop::RSpec::SingleArgumentMessageChain do + subject(:cop) { described_class.new } + + describe 'receive_message_chain' do + it 'reports single-argument calls' do + expect_offense(<<-RUBY) + before do + allow(foo).to receive_message_chain(:one) { :two } + ^^^^^^^^^^^^^^^^^^^^^ Use `receive` instead of calling `receive_message_chain` with a single argument. + end + RUBY + end + + include_examples( + 'autocorrect', + 'before { allow(foo).to receive_message_chain(:one) { :two } }', + 'before { allow(foo).to receive(:one) { :two } }' + ) + + it 'accepts multi-argument calls' do + expect_no_offenses(<<-RUBY) + before do + allow(foo).to receive_message_chain(:one, :two) { :three } + end + RUBY + end + + it 'reports single-argument string calls' do + expect_offense(<<-RUBY) + before do + allow(foo).to receive_message_chain("one") { :two } + ^^^^^^^^^^^^^^^^^^^^^ Use `receive` instead of calling `receive_message_chain` with a single argument. + end + RUBY + end + + include_examples( + 'autocorrect', + 'before { allow(foo).to receive_message_chain("one") { :two } }', + 'before { allow(foo).to receive("one") { :two } }' + ) + + it 'accepts multi-argument string calls' do + expect_no_offenses(<<-RUBY) + before do + allow(foo).to receive_message_chain("one.two") { :three } + end + RUBY + end + + context 'with single-key hash argument' do + it 'reports an offence' do + expect_offense(<<-RUBY) + before do + allow(foo).to receive_message_chain(bar: 42) + ^^^^^^^^^^^^^^^^^^^^^ Use `receive` instead of calling `receive_message_chain` with a single argument. + end + RUBY + end + + include_examples( + 'autocorrect', + 'before { allow(foo).to receive_message_chain(bar: 42) }', + 'before { allow(foo).to receive(:bar).and_return(42) }' + ) + + include_examples( + 'autocorrect', + 'before { allow(foo).to receive_message_chain("bar" => 42) }', + 'before { allow(foo).to receive("bar").and_return(42) }' + ) + + include_examples( + 'autocorrect', + 'before { allow(foo).to receive_message_chain(:"#{foo}" => 42) }', + 'before { allow(foo).to receive(:"#{foo}").and_return(42) }' + ) + end + + context 'with multiple keys hash argument' do + it "doesn't report an offence" do + expect_no_offenses(<<-RUBY) + before do + allow(foo).to receive_message_chain(bar: 42, baz: 42) + end + RUBY + end + end + end + + describe 'stub_chain' do + it 'reports single-argument calls' do + expect_offense(<<-RUBY) + before do + foo.stub_chain(:one) { :two } + ^^^^^^^^^^ Use `stub` instead of calling `stub_chain` with a single argument. + end + RUBY + end + + include_examples( + 'autocorrect', + 'before { foo.stub_chain(:one) { :two } }', + 'before { foo.stub(:one) { :two } }' + ) + + it 'accepts multi-argument calls' do + expect_no_offenses(<<-RUBY) + before do + foo.stub_chain(:one, :two) { :three } + end + RUBY + end + + it 'reports single-argument string calls' do + expect_offense(<<-RUBY) + before do + foo.stub_chain("one") { :two } + ^^^^^^^^^^ Use `stub` instead of calling `stub_chain` with a single argument. + end + RUBY + end + + include_examples( + 'autocorrect', + 'before { foo.stub_chain("one") { :two } }', + 'before { foo.stub("one") { :two } }' + ) + + it 'accepts multi-argument string calls' do + expect_no_offenses(<<-RUBY) + before do + foo.stub_chain("one.two") { :three } + end + RUBY + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/subject_stub_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/subject_stub_spec.rb new file mode 100644 index 0000000000..33335cfeaf --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/subject_stub_spec.rb @@ -0,0 +1,194 @@ +# frozen_string_literal: true + +RSpec.describe RuboCop::Cop::RSpec::SubjectStub do + subject(:cop) { described_class.new } + + it 'complains when subject is stubbed' do + expect_offense(<<-RUBY) + describe Foo do + subject(:foo) { described_class.new } + + before do + allow(foo).to receive(:bar).and_return(baz) + ^^^^^^^^^^ Do not stub your test subject. + end + + it 'uses expect twice' do + expect(foo.bar).to eq(baz) + end + end + RUBY + end + + it 'complains when subject is mocked' do + expect_offense(<<-RUBY) + describe Foo do + subject(:foo) { described_class.new } + + before do + expect(foo).to receive(:bar).and_return(baz) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Do not stub your test subject. + expect(foo).to receive(:bar) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Do not stub your test subject. + expect(foo).to receive(:bar).with(1) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Do not stub your test subject. + expect(foo).to receive(:bar).with(1).and_return(2) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Do not stub your test subject. + end + + it 'uses expect twice' do + expect(foo.bar).to eq(baz) + end + end + RUBY + end + + it 'ignores stub within context where subject name changed' do + expect_no_offenses(<<-RUBY) + describe Foo do + subject(:foo) { described_class.new } + + context 'when I shake things up' do + subject(:bar) { described_class.new } + + it 'tries to trick rubocop-rspec' do + allow(foo).to receive(:baz) + end + end + end + RUBY + end + + it 'ignores stub when inside all matcher' do + expect_no_offenses(<<-RUBY) + describe Foo do + subject(:foo) { [Object.new] } + it 'tries to trick rubocop-rspec' do + expect(foo).to all(receive(:baz)) + end + end + RUBY + end + + it 'flags nested subject stubs when nested subject uses same name' do + expect_offense(<<-RUBY) + describe Foo do + subject(:foo) { described_class.new } + + context 'when I shake things up' do + subject(:foo) { described_class.new } + + before do + allow(foo).to receive(:wow) + ^^^^^^^^^^ Do not stub your test subject. + end + + it 'tries to trick rubocop-rspec' do + expect(foo).to eql(:neat) + end + end + end + RUBY + end + + it 'ignores nested stubs when nested subject is anonymous' do + expect_no_offenses(<<-RUBY) + describe Foo do + subject(:foo) { described_class.new } + + context 'when I shake things up' do + subject { described_class.new } + + before do + allow(foo).to receive(:wow) + end + + it 'tries to trick rubocop-rspec' do + expect(foo).to eql(:neat) + end + end + end + RUBY + end + + it 'flags nested subject stubs when example group does not define subject' do + expect_offense(<<-RUBY) + describe Foo do + subject(:foo) { described_class.new } + + context 'when I shake things up' do + before do + allow(foo).to receive(:wow) + ^^^^^^^^^^ Do not stub your test subject. + end + + it 'tries to trick rubocop-rspec' do + expect(foo).to eql(:neat) + end + end + end + RUBY + end + + it 'flags nested subject stubs' do + expect_offense(<<-RUBY) + describe Foo do + subject(:foo) { described_class.new } + + context 'when I shake things up' do + subject(:bar) { described_class.new } + + before do + allow(foo).to receive(:wow) + allow(bar).to receive(:wow) + ^^^^^^^^^^ Do not stub your test subject. + end + + it 'tries to trick rubocop-rspec' do + expect(bar).to eql(foo) + end + end + end + RUBY + end + + it 'flags nested subject stubs when adjacent context redefines' do + expect_offense(<<-RUBY) + describe Foo do + subject(:foo) { described_class.new } + + context 'when I do something in a context' do + subject { blah } + end + + it 'still flags this test' do + allow(foo).to receive(:blah) + ^^^^^^^^^^ Do not stub your test subject. + end + end + RUBY + end + + it 'flags deeply nested subject stubs' do + expect_offense(<<-RUBY) + describe Foo do + subject(:foo) { described_class.new } + + context 'level 1' do + subject(:bar) { described_class.new } + + context 'level 2' do + subject(:baz) { described_class.new } + + before do + allow(foo).to receive(:wow) + allow(bar).to receive(:wow) + allow(baz).to receive(:wow) + ^^^^^^^^^^ Do not stub your test subject. + end + end + end + end + RUBY + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/unspecified_exception_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/unspecified_exception_spec.rb new file mode 100644 index 0000000000..65354b81ea --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/unspecified_exception_spec.rb @@ -0,0 +1,175 @@ +RSpec.describe RuboCop::Cop::RSpec::UnspecifiedException do + subject(:cop) { described_class.new } + + context 'with raise_error matcher' do + it 'detects the `unspecified_exception` offense' do + expect_offense(<<-RUBY) + expect { + raise StandardError + }.to raise_error + ^^^^^^^^^^^ Specify the exception being captured + RUBY + end + + it 'allows empty exception specification when not expecting an error' do + expect_no_offenses(<<-RUBY) + expect { + raise StandardError + }.not_to raise_error + RUBY + end + + it 'allows exception classes' do + expect_no_offenses(<<-RUBY) + expect { + raise StandardError + }.to raise_error(StandardError) + RUBY + end + + it 'allows exception messages' do + expect_no_offenses(<<-RUBY) + expect { + raise StandardError.new('error') + }.to raise_error('error') + RUBY + end + + it 'allows exception types with messages' do + expect_no_offenses(<<-RUBY) + expect { + raise StandardError.new('error') + }.to raise_error(StandardError, 'error') + RUBY + end + + it 'allows exception matching regular expressions' do + expect_no_offenses(<<-RUBY) + expect { + raise StandardError.new('error') + }.to raise_error(/err/) + RUBY + end + + it 'allows exception types with matching regular expressions' do + expect_no_offenses(<<-RUBY) + expect { + raise StandardError.new('error') + }.to raise_error(StandardError, /err/) + RUBY + end + + it 'allows classes with blocks with braces' do + expect_no_offenses(<<-RUBY) + expect { + raise StandardError.new('error') + }.to raise_error { |err| err.data } + RUBY + end + + it 'allows classes with blocks with do/end' do + expect_no_offenses(<<-RUBY) + expect { + raise StandardError.new('error') + }.to raise_error do |error| + error.data + end + RUBY + end + + it 'allows parameterized exceptions' do + expect_no_offenses(<<-RUBY) + my_exception = StandardError.new('my exception') + expect { + raise my_exception + }.to raise_error(my_exception) + RUBY + end + end + + context 'with raise_exception matcher' do + it 'detects the `unspecified_exception` offense' do + expect_offense(<<-RUBY) + expect { + raise StandardError + }.to raise_exception + ^^^^^^^^^^^^^^^ Specify the exception being captured + RUBY + end + + it 'allows empty exception specification when not expecting an error' do + expect_no_offenses(<<-RUBY) + expect { + raise StandardError + }.not_to raise_exception + RUBY + end + + it 'allows exception classes' do + expect_no_offenses(<<-RUBY) + expect { + raise StandardError + }.to raise_exception(StandardError) + RUBY + end + + it 'allows exception messages' do + expect_no_offenses(<<-RUBY) + expect { + raise StandardError.new('error') + }.to raise_exception('error') + RUBY + end + + it 'allows exception types with messages' do + expect_no_offenses(<<-RUBY) + expect { + raise StandardError.new('error') + }.to raise_exception(StandardError, 'error') + RUBY + end + + it 'allows exception matching regular expressions' do + expect_no_offenses(<<-RUBY) + expect { + raise StandardError.new('error') + }.to raise_exception(/err/) + RUBY + end + + it 'allows exception types with matching regular expressions' do + expect_no_offenses(<<-RUBY) + expect { + raise StandardError.new('error') + }.to raise_exception(StandardError, /err/) + RUBY + end + + it 'allows classes with blocks with braces' do + expect_no_offenses(<<-RUBY) + expect { + raise StandardError.new('error') + }.to raise_exception { |err| err.data } + RUBY + end + + it 'allows classes with blocks with do/end' do + expect_no_offenses(<<-RUBY) + expect { + raise StandardError.new('error') + }.to raise_exception do |error| + error.data + end + RUBY + end + + it 'allows parameterized exceptions' do + expect_no_offenses(<<-RUBY) + my_exception = StandardError.new('my exception') + expect { + raise my_exception + }.to raise_exception(my_exception) + RUBY + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/verified_doubles_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/verified_doubles_spec.rb new file mode 100644 index 0000000000..9fa8070260 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/verified_doubles_spec.rb @@ -0,0 +1,84 @@ +RSpec.describe RuboCop::Cop::RSpec::VerifiedDoubles, :config do + subject(:cop) { described_class.new(config) } + + it 'finds a `double` instead of an `instance_double`' do + expect_offense(<<-RUBY) + it do + foo = double("Widget") + ^^^^^^^^^^^^^^^^ Prefer using verifying doubles over normal doubles. + end + RUBY + end + + context 'when configuration does not specify IgnoreSymbolicNames' do + let(:cop_config) { {} } + + it 'find doubles whose name is a symbol' do + expect_offense(<<-RUBY) + it do + foo = double(:widget) + ^^^^^^^^^^^^^^^ Prefer using verifying doubles over normal doubles. + end + RUBY + end + + it 'finds a `spy` instead of an `instance_spy`' do + expect_offense(<<-RUBY) + it do + foo = spy("Widget") + ^^^^^^^^^^^^^ Prefer using verifying doubles over normal doubles. + end + RUBY + end + end + + context 'when configured to ignore symbolic names' do + let(:cop_config) { { 'IgnoreSymbolicNames' => true } } + + it 'ignores doubles whose name is a symbol' do + expect_no_offenses(<<-RUBY) + it do + foo = double(:widget) + end + RUBY + end + + it 'still flags doubles whose name is a string' do + expect_offense(<<-RUBY) + it do + foo = double("widget") + ^^^^^^^^^^^^^^^^ Prefer using verifying doubles over normal doubles. + end + RUBY + end + end + + it 'doubles that have no name specified' do + expect_offense(<<-RUBY) + it do + foo = double + ^^^^^^ Prefer using verifying doubles over normal doubles. + end + RUBY + end + + context 'when configured to ignore nameless doubles' do + let(:cop_config) { { 'IgnoreNameless' => true } } + + it 'ignores doubles that have no name specified' do + expect_no_offenses(<<-RUBY) + it do + foo = double + end + RUBY + end + end + + it 'ignores instance_doubles' do + expect_no_offenses(<<-RUBY) + it do + foo = instance_double("Foo") + end + RUBY + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/void_expect_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/void_expect_spec.rb new file mode 100644 index 0000000000..56ff5194e4 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/cop/rspec/void_expect_spec.rb @@ -0,0 +1,47 @@ +RSpec.describe RuboCop::Cop::RSpec::VoidExpect do + subject(:cop) { described_class.new } + + it 'registers offenses to void `expect`' do + expect_offense(<<-RUBY) + it 'something' do + something = 1 + expect(something) + ^^^^^^^^^^^^^^^^^ Do not use `expect()` without `.to` or `.not_to`. Chain the methods or remove it. + end + RUBY + end + + it 'registers offenses to void `expect` when block has one expression' do + expect_offense(<<-RUBY) + it 'something' do + expect(something) + ^^^^^^^^^^^^^^^^^ Do not use `expect()` without `.to` or `.not_to`. Chain the methods or remove it. + end + RUBY + end + + it 'registers offenses to void `expect` with block' do + expect_offense(<<-RUBY) + it 'something' do + expect{something} + ^^^^^^^^^^^^^^^^^ Do not use `expect()` without `.to` or `.not_to`. Chain the methods or remove it. + end + RUBY + end + + it 'accepts non-void `expect`' do + expect_no_offenses(<<-RUBY) + it 'something' do + expect(something).to be 1 + end + RUBY + end + + it 'accepts non-void `expect` with block' do + expect_no_offenses(<<-RUBY) + it 'something' do + expect{something}.to raise_error(StandardError) + end + RUBY + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/config_formatter_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/config_formatter_spec.rb new file mode 100644 index 0000000000..71807e0e24 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/config_formatter_spec.rb @@ -0,0 +1,50 @@ +require 'rubocop/rspec/config_formatter' + +RSpec.describe RuboCop::RSpec::ConfigFormatter do + let(:config) do + { + 'AllCops' => { + 'Setting' => 'fourty two' + }, + 'RSpec/Foo' => { + 'Config' => 2, + 'Enabled' => true + }, + 'RSpec/Bar' => { + 'Enabled' => true + } + } + end + + let(:descriptions) do + { + 'RSpec/Foo' => { + 'Description' => 'Blah' + }, + 'RSpec/Bar' => { + 'Description' => 'Wow' + } + } + end + + it 'builds a YAML dump with spacing between cops' do + formatter = described_class.new(config, descriptions) + + expect(formatter.dump).to eql(<<-YAML.gsub(/^\s+\|/, '')) + |--- + |AllCops: + | Setting: fourty two + | + |RSpec/Foo: + | Config: 2 + | Enabled: true + | Description: Blah + | StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Foo + | + |RSpec/Bar: + | Enabled: true + | Description: Wow + | StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Bar + YAML + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/description_extractor_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/description_extractor_spec.rb new file mode 100644 index 0000000000..d2210902b5 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/description_extractor_spec.rb @@ -0,0 +1,61 @@ +require 'yard' + +require 'rubocop/rspec/description_extractor' + +RSpec.describe RuboCop::RSpec::DescriptionExtractor do + let(:yardocs) do + YARD.parse_string(<<-RUBY) + # This is not a cop + class RuboCop::Cop::Mixin::Sneaky + end + + # This is not a concrete cop + # + # @abstract + class RuboCop::Cop::RSpec::Cop + end + + # Checks foo + # + # Some description + # + # @note only works with foo + class RuboCop::Cop::RSpec::Foo < RuboCop::Cop::RSpec::Cop + # Hello + def bar + end + + # :nodoc: + class HelperClassForFoo + end + end + + class RuboCop::Cop::RSpec::Undocumented < RuboCop::Cop::RSpec::Cop + # Hello + def bar + end + end + RUBY + + YARD::Registry.all + end + + def stub_cop_const(name) + stub_const( + "RuboCop::Cop::RSpec::#{name}", + Class.new(RuboCop::Cop.const_get(:WorkaroundCop)) + ) + end + + before do + stub_cop_const('Foo') + stub_cop_const('Undocumented') + end + + it 'builds a hash of descriptions' do + expect(described_class.new(yardocs).to_h).to eql( + 'RSpec/Foo' => { 'Description' => 'Checks foo' }, + 'RSpec/Undocumented' => { 'Description' => '' } + ) + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/example_group_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/example_group_spec.rb new file mode 100644 index 0000000000..e5fba6d70f --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/example_group_spec.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +RSpec.describe RuboCop::RSpec::ExampleGroup do + include RuboCop::AST::Sexp + + subject(:group) { described_class.new(parse_source(source).ast) } + + let(:source) do + <<-RUBY + RSpec.describe Foo do + it 'does x' do + x + end + + it 'does y' do + y + end + + context 'nested' do + it 'does z' do + z + end + end + end + RUBY + end + + let(:example_nodes) do + [ + s(:block, + s(:send, nil, :it, + s(:str, 'does x')), + s(:args), s(:send, nil, :x)), + s(:block, + s(:send, nil, :it, + s(:str, 'does y')), + s(:args), s(:send, nil, :y)) + ].map { |node| RuboCop::RSpec::Example.new(node) } + end + + it 'exposes examples in scope' do + expect(group.examples).to eql(example_nodes) + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/example_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/example_spec.rb new file mode 100644 index 0000000000..842936a167 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/example_spec.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +RSpec.describe RuboCop::RSpec::Example do + include RuboCop::AST::Sexp + + def example(source) + described_class.new(parse_source(source).ast) + end + + it 'extracts doc string' do + expect(example("it('does x') { foo }").doc_string) + .to eq(s(:str, 'does x')) + end + + it 'extracts doc string for unimplemented examples' do + expect(example("it('does x')").doc_string) + .to eq(s(:str, 'does x')) + end + + it 'returns nil for examples without doc strings' do + expect(example('it { foo }').doc_string).to be(nil) + end + + it 'extracts keywords' do + expect(example("it('foo', :bar, baz: :qux) { a }").metadata) + .to eq([s(:sym, :bar), s(:hash, s(:pair, s(:sym, :baz), s(:sym, :qux)))]) + end + + it 'extracts implementation' do + expect(example('it("foo") { bar; baz }').implementation) + .to eq(s(:begin, s(:send, nil, :bar), s(:send, nil, :baz))) + end + + it 'returns node' do + node = s(:sym, :node) + expect(described_class.new(node).to_node).to be(node) + end + + describe 'value object semantics' do + it 'compares by value' do + aggregate_failures 'equality semantics' do + expect(example('it("foo")')).to eq(example('it("foo")')) + expect(example('it("foo")')).not_to eq(example('it("bar")')) + end + end + + it 'can be used as a key in a hash' do + hash = {} + + hash[example('it("foo")')] = 123 + + expect(hash[example('it("foo")')]).to be(123) + end + + it 'computes #hash based on class and node' do + node = s(:node) + + expect(described_class.new(node).hash) + .to eql([described_class, node].hash) + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/hook_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/hook_spec.rb new file mode 100644 index 0000000000..ae8e4743bf --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/hook_spec.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +RSpec.describe RuboCop::RSpec::Hook do + include RuboCop::AST::Sexp + + def hook(source) + described_class.new(parse_source(source).ast) + end + + it 'extracts name' do + expect(hook('around(:each) { }').name).to be(:around) + end + + it 'does not break if a hook is not given a symbol literal' do + expect(hook('before(scope) { example_setup }').knowable_scope?).to be(false) + end + + it 'knows the scope of a hook with a symbol literal' do + expect(hook('before { example_setup }').knowable_scope?).to be(true) + end + + it 'ignores other arguments to hooks' do + expect(hook('before(:each, :metadata) { example_setup }').scope) + .to be(:each) + end + + it 'classifies nonstandard hook arguments as invalid' do + expect(hook('before(:nothing) { example_setup }').valid_scope?).to be(false) + end + + it 'classifies :each as a valid hook argument' do + expect(hook('before(:each) { example_setup }').valid_scope?).to be(true) + end + + it 'classifies :each as an example hook' do + expect(hook('before(:each) { }').example?).to be(true) + end + + shared_examples 'standardizes scope' do |source, scope| + it "interprets #{source} as having scope #{scope}" do + expect(hook(source).scope).to equal(scope) + end + end + + include_examples 'standardizes scope', 'before(:each) { }', :each + include_examples 'standardizes scope', 'around(:example) { }', :each + include_examples 'standardizes scope', 'after { }', :each + + include_examples 'standardizes scope', 'before(:all) { }', :context + include_examples 'standardizes scope', 'around(:context) { }', :context + + include_examples 'standardizes scope', 'after(:suite) { }', :suite +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/language/selector_set_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/language/selector_set_spec.rb new file mode 100644 index 0000000000..d67d02fbb5 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/language/selector_set_spec.rb @@ -0,0 +1,51 @@ +RSpec.describe RuboCop::RSpec::Language::SelectorSet do + subject(:selector_set) { described_class.new(%i[foo bar]) } + + it 'composes sets' do + combined = selector_set + described_class.new(%i[baz]) + + expect(combined).to eq(described_class.new(%i[foo bar baz])) + end + + it 'compares by value' do + expect(selector_set).not_to eq(described_class.new(%i[foo bar baz])) + end + + describe '#include?' do + it 'returns false for selectors not in the set' do + expect(selector_set.include?(:baz)).to be(false) + end + + it 'returns true for selectors in the set' do + expect(selector_set.include?(:foo)).to be(true) + end + end + + describe '#node_pattern' do + it 'builds a node pattern' do + expect(selector_set.node_pattern).to eql(':foo :bar') + end + end + + describe '#node_pattern_union' do + it 'builds a node pattern union' do + expect(selector_set.node_pattern_union).to eql('{:foo :bar}') + end + end + + describe '#send_pattern' do + it 'builds a send matching pattern' do + expect(selector_set.send_pattern).to eql( + '(send {(const nil? :RSpec) nil?} {:foo :bar} ...)' + ) + end + end + + describe '#block_pattern' do + it 'builds a block matching pattern' do + expect(selector_set.block_pattern).to eql( + '(block (send {(const nil? :RSpec) nil?} {:foo :bar} ...) ...)' + ) + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/util/one_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/util/one_spec.rb new file mode 100644 index 0000000000..5941e7a841 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/util/one_spec.rb @@ -0,0 +1,21 @@ +RSpec.describe RuboCop::RSpec::Util, '.one' do + let(:first) { instance_double(Object) } + let(:array) { instance_double(Array, one?: true, first: first) } + let(:client) { Class.new.extend(described_class) } + + it 'returns first element' do + expect(client.one(array)).to be(first) + end + + it 'fails if the list is empty' do + expect { client.one([]) } + .to raise_error(described_class::SizeError) + .with_message('expected size to be exactly 1 but size was 0') + end + + it 'fails if the list has more than one element' do + expect { client.one([1, 2]) } + .to raise_error(described_class::SizeError) + .with_message('expected size to be exactly 1 but size was 2') + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/wording_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/wording_spec.rb new file mode 100644 index 0000000000..0f14d906b6 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/rubocop/rspec/wording_spec.rb @@ -0,0 +1,50 @@ +RSpec.describe RuboCop::RSpec::Wording do + let(:replacements) { { 'have' => 'has' } } + let(:ignores) { %w[only really] } + + expected_rewrites = + { + 'should return something' => 'returns something', + 'should not return something' => 'does not return something', + 'should do nothing' => 'does nothing', + 'should have sweets' => 'has sweets', + 'should worry about the future' => 'worries about the future', + 'should pay for pizza' => 'pays for pizza', + 'should obey my orders' => 'obeys my orders', + 'should deploy the app' => 'deploys the app', + 'should buy the product' => 'buys the product', + 'should miss me' => 'misses me', + 'should fax the document' => 'faxes the document', + 'should amass debt' => 'amasses debt', + 'should echo the input' => 'echoes the input', + 'should alias the method' => 'aliases the method', + 'should search the internet' => 'searches the internet', + 'should wish me luck' => 'wishes me luck', + 'should really only return one item' => 'really only returns one item', + "shouldn't return something" => 'does not return something', + 'SHOULD RETAIN UPPERCASE' => 'RETAINS UPPERCASE', + "shouldn't be true" => 'is not true', + "SHOULDN'T BE true" => 'IS NOT true', + "SHOULDN'T NOT RETAIN UPPERCASE" => 'DOES NOT NOT RETAIN UPPERCASE', + 'should WORRY' => 'WORRIES', + 'should WISH me luck' => 'WISHES me luck', + '' => '', + 'should' => '', + "shouldn't" => 'does not', + 'should not' => 'does not', + 'should fizz' => 'fizzes' + } + + expected_rewrites.each do |old, new| + it %(rewrites "#{old}" as "#{new}") do + rewrite = + described_class.new( + old, + replace: replacements, + ignore: ignores + ).rewrite + + expect(rewrite).to eql(new) + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/shared/autocorrect_behavior.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/shared/autocorrect_behavior.rb new file mode 100644 index 0000000000..5d1d9bb982 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/shared/autocorrect_behavior.rb @@ -0,0 +1,7 @@ +RSpec.shared_examples 'autocorrect' do |original, corrected| + it "autocorrects `#{original}` to `#{corrected}`" do + autocorrected = autocorrect_source(original, 'spec/foo_spec.rb') + + expect(autocorrected).to eql(corrected) + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/shared/detects_style_behavior.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/shared/detects_style_behavior.rb new file mode 100644 index 0000000000..e9022b0cdf --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/shared/detects_style_behavior.rb @@ -0,0 +1,7 @@ +RSpec.shared_examples 'detects style' do |source, style, filename: 'x_spec.rb'| + it 'generates a todo based on the detected style' do + inspect_source(source, filename) + + expect(cop.config_to_allow_offenses).to eq('EnforcedStyle' => style) + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/shared/smoke_test_examples.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/shared/smoke_test_examples.rb new file mode 100644 index 0000000000..61f30e76a8 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/shared/smoke_test_examples.rb @@ -0,0 +1,25 @@ +RSpec.shared_examples 'smoke test', type: :cop_spec do + context 'with default configuration' do + # This is overridden to avoid a number of specs that define `cop_config` + # (so it is referenced in the 'config' shared context) but do not define + # all of the dependent configuration options until inside of a context + # that is out of scope, causing a NameError. + let(:cop_config) { {} } + + stress_tests = Pathname.glob('spec/smoke_tests/*.rb') + + raise 'No smoke tests could be found!' if stress_tests.empty? + + stress_tests.each do |path| + it "does not crash on smoke test: #{path}" do + source = path.read + file_name = path.to_s + + aggregate_failures do + expect { inspect_source(source, file_name) }.not_to raise_error + expect { autocorrect_source(source, file_name) }.not_to raise_error + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/smoke_tests/empty_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/smoke_tests/empty_spec.rb new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/smoke_tests/factory_bot_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/smoke_tests/factory_bot_spec.rb new file mode 100644 index 0000000000..4a517cd669 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/smoke_tests/factory_bot_spec.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +# Since FactoryBot is not a dependency, none of this should be executed. We just +# need the AST to exist. +if false + FactoryBot.define do + factory :foo do + bar {} + end + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/smoke_tests/no_tests_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/smoke_tests/no_tests_spec.rb new file mode 100644 index 0000000000..fd7c2d5f46 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/smoke_tests/no_tests_spec.rb @@ -0,0 +1,4 @@ +# frozen_string_literal: + +# This is sort of a test, but there's no rspec to see here. +raise 'Uh oh, the Party seems to have gotten into ruby.' if 2 + 2 == 5 diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/smoke_tests/weird_rspec_spec.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/smoke_tests/weird_rspec_spec.rb new file mode 100644 index 0000000000..debd97a650 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/smoke_tests/weird_rspec_spec.rb @@ -0,0 +1,233 @@ +RSpec.describe 'Weirdness' do + subject! { nil } + subject { nil } + subject(:foo) { nil } + subject!(:foo) { nil } + + subject! (:foo) { |something| nil } + subject :foo do end + + let(:foo) { |something| something } + let (:foo) { 1 } + let! (:bar){} + + let :a do end + + let(:bar) { <<-HEREDOC } + What a pain. + HEREDOC + + let(:bar) { <<-'HEREDOC' } + Even odder. + HEREDOC + + let(:baz) do + <<-INSIDE + Hi. I'm in your lets. + INSIDE + end + + let(:hi) {} + let(:bye) do + end + + let(:doop) { foo; 1 } + + it {} + specify {} + + it 'works', metadata: true do + end + + describe {} + context {} + + describe '#nothing' do + end + + it 'is empty' do + end + + it '' do end + describe do end + context do end + shared_examples 'a' do end + + describe 'things' do + context 'with context' do + end + end + + shared_examples 'weird rspec' do + end + + shared_examples :something do + end + + context 'test' do + include_examples 'weird rspec' + include_examples('weird rspec', serious: true) do + it_behaves_like :something + end + end + + it_behaves_like :something + it_should_behave_like :something + + it_behaves_like :something do + let(:foo) { 'bar' } + end + + it_behaves_like(:something) do |arg, *args, &block| + end + + before {} + context 'never run' do + around {} + end + after {} + + before { <<-DOC } + Eh, what's up? + DOC + + around { |test| test.run; <<-DOC } + Eh, what's up? + DOC + + after { <<-DOC } + Eh, what's up? + DOC + + around do |test| + test.run + end + + it 'is expecting you' do + expect('you').to eql('you') + end + + it 'is expecting you not to raise an error' do + expect { 'you' }.not_to raise_error + end + + it 'has chained expectations' do + expect('you').to eql('you').and(match(/y/)) + end + + %w[who likes dynamic examples].each do |word| + let(word) { word } + + describe "#{word}" do + context "#{word}" do + it "lets the word '#{word}' be '#{word}'" do + expect(send(word)).to eql(word) + end + end + end + end + + it { foo; 1 && 2} + it('has a description too') { foo; 1 && 2} + + it %{quotes a string weird} do + end + + it((' '.strip! ; 1 && 'isnt a simple string')) do + expect(nil).to be(nil) + end + + it((' '.strip! ; 1 && 'isnt a simple string')) do + double = double(:foo) + + allow(double).to receive(:oogabooga).with(nil).and_return(nil) + + expect(double.oogabooga(nil)).to be(nil) + + expect(double).to have_received(:oogabooga).once + end + + it 'uses a matcher' do + expect([].empty?).to be(true) + expect([]).to be_empty + end + + let(:klass) do + Class.new do + def initialize(thing) + @thing = thing + end + + def announce + 'wooo, so dynamic!' + end + end + end + + it 'it does a thing' do + end + + it 'It does a thing' do + end + + it 'should not do the thing' do + end + + specify do + foo = double(:bar) + allow(foo).to receive_message_chain(bar: 42, baz: 42) + allow(foo).to receive(:bar) + allow(foo).to receive_messages(bar: 42, baz: 42) + end +end + +RSpec.describe {} +RSpec.shared_examples('pointless') {} +RSpec.shared_context('even pointless-er') {} +RSpec.describe do end +RSpec.shared_examples('pointless2') do end +RSpec.shared_context('even pointless-er2') do end + +class Broken +end + +RSpec.describe Broken do +end + +RSpec.describe 'RubocopBug' do + subject { true } + + before do + each_row = allow(double(:exporter)).to receive(:each_row) + + [1, 2].each do |sig| + each_row = each_row.and_yield(sig) + end + end + + it 'has a single example' do + expect(subject).to be_truthy + end + + it 'has an expectation' do + stats = double(event: nil) + + stats.event('tada!') + + expect(stats) + .to have_received(:event) + .with('tada!') + end +end + +RSpec.describe do + let(:uh_oh) { <<-HERE.strip + ", #{<<-THERE.strip}" } + Seriously + HERE + who designed these things? + THERE + + it 'is insane' do + expect(uh_oh).to eql('Seriously, who designed these things?') + end +end diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/spec_helper.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/spec_helper.rb new file mode 100644 index 0000000000..46ec833076 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/spec_helper.rb @@ -0,0 +1,48 @@ +require 'rubocop' + +require 'rubocop/rspec/support' + +if ENV['COVERAGE'] == 'true' + require 'simplecov' + SimpleCov.start +end + +module SpecHelper + ROOT = Pathname.new(__dir__).parent.freeze +end + +spec_helper_glob = File.expand_path('{support,shared}/*.rb', __dir__) +Dir.glob(spec_helper_glob).map(&method(:require)) + +RSpec.configure do |config| + config.define_derived_metadata(file_path: %r{/spec/rubocop/cop/}) do |meta| + meta[:type] = :cop_spec + end + + config.order = :random + + config.expect_with :rspec do |expectations| + expectations.syntax = :expect # Disable `should` + end + + config.mock_with :rspec do |mocks| + mocks.syntax = :expect # Disable `should_receive` and `stub` + end + + # Forbid RSpec from monkey patching any of our objects + config.disable_monkey_patching! + + # We should address configuration warnings when we upgrade + config.raise_errors_for_deprecations! + + # RSpec gives helpful warnings when you are doing something wrong. + # We should take their advice! + config.raise_on_warning = true + + config.include(ExpectOffense) +end + +$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) +$LOAD_PATH.unshift(File.dirname(__FILE__)) + +require 'rubocop-rspec' diff --git a/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/support/expect_offense.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/support/expect_offense.rb new file mode 100644 index 0000000000..984ed1ee44 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.30.1/spec/support/expect_offense.rb @@ -0,0 +1,17 @@ +# rubocop-rspec gem extension of RuboCop's ExpectOffense module. +# +# This mixin is the same as rubocop's ExpectOffense except the default +# filename ends with `_spec.rb` +module ExpectOffense + include RuboCop::RSpec::ExpectOffense + + DEFAULT_FILENAME = 'example_spec.rb'.freeze + + def expect_offense(source, filename = DEFAULT_FILENAME) + super + end + + def expect_no_offenses(source, filename = DEFAULT_FILENAME) + super + end +end From 96719383b1671ad2b6a8458f4541b701689a143a Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Fri, 2 Nov 2018 13:10:05 +0000 Subject: [PATCH 2/5] RuboCop Cask 0.23.0 Co-Authored-By: MikeMcQuaid --- Library/Homebrew/constants.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/constants.rb b/Library/Homebrew/constants.rb index 57fd418f5b..3e1e748d85 100644 --- a/Library/Homebrew/constants.rb +++ b/Library/Homebrew/constants.rb @@ -2,4 +2,4 @@ # RuboCop version used for `brew style` and `brew cask style` HOMEBREW_RUBOCOP_VERSION = "0.60.0" -HOMEBREW_RUBOCOP_CASK_VERSION = "~> 0.22.0" # has to be updated when RuboCop version changes +HOMEBREW_RUBOCOP_CASK_VERSION = "~> 0.23.0" # has to be updated when RuboCop version changes From acd7f5714ee2f8d37ac47b745ce341870563cd2d Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 2 Nov 2018 17:17:35 +0000 Subject: [PATCH 3/5] rubocop.yml: configure Hash alignment. --- Library/.rubocop.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Library/.rubocop.yml b/Library/.rubocop.yml index d6cfcb03bc..7a6800c76b 100644 --- a/Library/.rubocop.yml +++ b/Library/.rubocop.yml @@ -19,6 +19,11 @@ FormulaAuditStrict: NewFormulaAudit: Enabled: false +# make our hashes consistent +Layout/AlignHash: + EnforcedHashRocketStyle: table + EnforcedColonStyle: table + # `system` is a special case and aligns on second argument Layout/AlignParameters: Enabled: false From 737b84b54b86301ca282fc272febf13b4344fd23 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 2 Nov 2018 17:18:07 +0000 Subject: [PATCH 4/5] `brew style --fix` fixes. --- Library/Homebrew/build.rb | 4 +- .../cask/artifact/abstract_uninstall.rb | 4 +- Library/Homebrew/cask/artifact/pkg.rb | 4 +- Library/Homebrew/cask/auditor.rb | 2 +- Library/Homebrew/cask/cask.rb | 22 +-- Library/Homebrew/cask/cmd/audit.rb | 4 +- Library/Homebrew/cask/cmd/upgrade.rb | 8 +- Library/Homebrew/cask/dsl/depends_on.rb | 4 +- Library/Homebrew/cask/dsl/version.rb | 4 +- Library/Homebrew/cask/installer.rb | 6 +- Library/Homebrew/cask/pkg.rb | 8 +- Library/Homebrew/cask/quarantine.rb | 12 +- Library/Homebrew/cleanup.rb | 2 +- Library/Homebrew/cli_parser.rb | 6 +- Library/Homebrew/cmd/deps.rb | 10 +- Library/Homebrew/cmd/outdated.rb | 8 +- Library/Homebrew/cmd/search.rb | 4 +- Library/Homebrew/cmd/tap.rb | 6 +- Library/Homebrew/cmd/update-report.rb | 4 +- Library/Homebrew/compilers.rb | 10 +- Library/Homebrew/dev-cmd/audit.rb | 4 +- Library/Homebrew/dev-cmd/bottle.rb | 22 +-- Library/Homebrew/dev-cmd/bump-formula-pr.rb | 6 +- Library/Homebrew/dev-cmd/irb.rb | 2 +- Library/Homebrew/download_strategy.rb | 36 ++-- .../Homebrew/extend/os/mac/hardware/cpu.rb | 8 +- .../Homebrew/extend/os/mac/keg_relocate.rb | 2 +- .../extend/os/mac/unpack_strategy/zip.rb | 6 +- Library/Homebrew/extend/pathname.rb | 2 +- Library/Homebrew/formula.rb | 104 +++++----- Library/Homebrew/formula_versions.rb | 2 +- Library/Homebrew/global.rb | 34 ++-- Library/Homebrew/hardware.rb | 2 +- Library/Homebrew/keg.rb | 4 +- Library/Homebrew/keg_relocate.rb | 20 +- Library/Homebrew/locale.rb | 8 +- Library/Homebrew/official_taps.rb | 2 +- Library/Homebrew/os/mac/version.rb | 22 +-- Library/Homebrew/os/mac/xquartz.rb | 30 +-- Library/Homebrew/pkg_version.rb | 2 +- .../Homebrew/requirements/java_requirement.rb | 2 +- Library/Homebrew/rubocops/class_cop.rb | 2 +- Library/Homebrew/search.rb | 6 +- Library/Homebrew/system_config.rb | 10 +- Library/Homebrew/tab.rb | 130 ++++++------- Library/Homebrew/tap.rb | 14 +- Library/Homebrew/tap_constants.rb | 8 +- .../Homebrew/test/cask/artifact/pkg_spec.rb | 20 +- .../artifact/uninstall_zap_shared_examples.rb | 4 +- Library/Homebrew/test/cmd/outdated_spec.rb | 16 +- Library/Homebrew/test/cmd/search_spec.rb | 8 +- .../Homebrew/test/compiler_selector_spec.rb | 4 +- .../Homebrew/test/download_strategies_spec.rb | 4 +- .../test/rubocops/homepage_cop_spec.rb | 68 +++---- .../test/rubocops/patches_cop_spec.rb | 184 +++++++++--------- .../Homebrew/test/rubocops/urls_cop_spec.rb | 8 +- Library/Homebrew/test/search_spec.rb | 4 +- Library/Homebrew/test/software_spec_spec.rb | 6 +- .../spec/shared_context/integration_test.rb | 12 +- Library/Homebrew/test/system_command_spec.rb | 6 +- Library/Homebrew/test/tab_spec.rb | 10 +- Library/Homebrew/test/utils/github_spec.rb | 4 +- Library/Homebrew/test/utils_spec.rb | 2 +- Library/Homebrew/unpack_strategy.rb | 4 +- Library/Homebrew/unpack_strategy/air.rb | 2 +- Library/Homebrew/unpack_strategy/bzip2.rb | 2 +- Library/Homebrew/unpack_strategy/cab.rb | 4 +- Library/Homebrew/unpack_strategy/directory.rb | 2 +- Library/Homebrew/unpack_strategy/dmg.rb | 24 +-- Library/Homebrew/unpack_strategy/fossil.rb | 6 +- .../Homebrew/unpack_strategy/generic_unar.rb | 4 +- Library/Homebrew/unpack_strategy/gzip.rb | 2 +- Library/Homebrew/unpack_strategy/lha.rb | 4 +- Library/Homebrew/unpack_strategy/lzip.rb | 4 +- Library/Homebrew/unpack_strategy/lzma.rb | 4 +- Library/Homebrew/unpack_strategy/mercurial.rb | 4 +- Library/Homebrew/unpack_strategy/p7zip.rb | 4 +- Library/Homebrew/unpack_strategy/pax.rb | 4 +- Library/Homebrew/unpack_strategy/rar.rb | 4 +- .../Homebrew/unpack_strategy/subversion.rb | 4 +- Library/Homebrew/unpack_strategy/tar.rb | 2 +- Library/Homebrew/unpack_strategy/xar.rb | 2 +- Library/Homebrew/unpack_strategy/xz.rb | 4 +- Library/Homebrew/unpack_strategy/zip.rb | 4 +- Library/Homebrew/utils/curl.rb | 14 +- Library/Homebrew/utils/shell.rb | 10 +- Library/Homebrew/utils/tty.rb | 20 +- Library/Homebrew/version.rb | 14 +- 88 files changed, 567 insertions(+), 567 deletions(-) diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb index df2565da66..82acee2a44 100644 --- a/Library/Homebrew/build.rb +++ b/Library/Homebrew/build.rb @@ -104,8 +104,8 @@ class Build new_env = { "TMPDIR" => HOMEBREW_TEMP, - "TEMP" => HOMEBREW_TEMP, - "TMP" => HOMEBREW_TEMP, + "TEMP" => HOMEBREW_TEMP, + "TMP" => HOMEBREW_TEMP, } with_env(new_env) do diff --git a/Library/Homebrew/cask/artifact/abstract_uninstall.rb b/Library/Homebrew/cask/artifact/abstract_uninstall.rb index 411c970811..0714283c4e 100644 --- a/Library/Homebrew/cask/artifact/abstract_uninstall.rb +++ b/Library/Homebrew/cask/artifact/abstract_uninstall.rb @@ -269,9 +269,9 @@ module Cask puts path command.run!( "/usr/bin/xargs", - args: ["-0", "--", "/bin/rm", "-r", "-f", "--"], + args: ["-0", "--", "/bin/rm", "-r", "-f", "--"], input: resolved_paths.join("\0"), - sudo: true, + sudo: true, ) end end diff --git a/Library/Homebrew/cask/artifact/pkg.rb b/Library/Homebrew/cask/artifact/pkg.rb index 825ad937a2..add64dbebf 100644 --- a/Library/Homebrew/cask/artifact/pkg.rb +++ b/Library/Homebrew/cask/artifact/pkg.rb @@ -52,8 +52,8 @@ module Cask with_choices_file do |choices_path| args << "-applyChoiceChangesXML" << choices_path if choices_path env = { - "LOGNAME" => User.current, - "USER" => User.current, + "LOGNAME" => User.current, + "USER" => User.current, "USERNAME" => User.current, } command.run!("/usr/sbin/installer", sudo: true, args: args, print_stdout: true, env: env) diff --git a/Library/Homebrew/cask/auditor.rb b/Library/Homebrew/cask/auditor.rb index 4de53cd573..4fb30e7acd 100644 --- a/Library/Homebrew/cask/auditor.rb +++ b/Library/Homebrew/cask/auditor.rb @@ -60,7 +60,7 @@ module Cask download = audit_download? && Download.new(cask, quarantine: quarantine?) audit = Audit.new(cask, download: download, check_token_conflicts: check_token_conflicts?, - commit_range: commit_range) + commit_range: commit_range) audit.run! puts audit.summary audit.success? diff --git a/Library/Homebrew/cask/cask.rb b/Library/Homebrew/cask/cask.rb index a8312cb86d..12d578df81 100644 --- a/Library/Homebrew/cask/cask.rb +++ b/Library/Homebrew/cask/cask.rb @@ -116,13 +116,13 @@ module Cask def to_h { - "name" => name, - "homepage" => homepage, - "url" => url, - "appcast" => appcast, - "version" => version, - "sha256" => sha256, - "artifacts" => artifacts.map do |a| + "name" => name, + "homepage" => homepage, + "url" => url, + "appcast" => appcast, + "version" => version, + "sha256" => sha256, + "artifacts" => artifacts.map do |a| if a.respond_to? :to_h a.to_h elsif a.respond_to? :to_a @@ -131,11 +131,11 @@ module Cask a end end, - "caveats" => caveats, - "depends_on" => depends_on, + "caveats" => caveats, + "depends_on" => depends_on, "conflicts_with" => conflicts_with.to_a, - "container" => container, - "auto_updates" => auto_updates, + "container" => container, + "auto_updates" => auto_updates, } end end diff --git a/Library/Homebrew/cask/cmd/audit.rb b/Library/Homebrew/cask/cmd/audit.rb index 7bfff0d2f0..a127bd4b10 100644 --- a/Library/Homebrew/cask/cmd/audit.rb +++ b/Library/Homebrew/cask/cmd/audit.rb @@ -19,9 +19,9 @@ module Cask def audit(cask) odebug "Auditing Cask #{cask}" - Auditor.audit(cask, audit_download: download?, + Auditor.audit(cask, audit_download: download?, check_token_conflicts: token_conflicts?, - quarantine: quarantine?) + quarantine: quarantine?) end end end diff --git a/Library/Homebrew/cask/cmd/upgrade.rb b/Library/Homebrew/cask/cmd/upgrade.rb index ff30fd885f..d12a03630e 100644 --- a/Library/Homebrew/cask/cmd/upgrade.rb +++ b/Library/Homebrew/cask/cmd/upgrade.rb @@ -45,10 +45,10 @@ module Cask old_cask = CaskLoader.load(old_cask.installed_caskfile) old_cask_installer = - Installer.new(old_cask, binaries: binaries?, - verbose: verbose?, - force: force?, - upgrade: true) + Installer.new(old_cask, binaries: binaries?, + verbose: verbose?, + force: force?, + upgrade: true) new_cask = CaskLoader.load(old_cask.to_s) diff --git a/Library/Homebrew/cask/dsl/depends_on.rb b/Library/Homebrew/cask/dsl/depends_on.rb index 519b0a5c67..6608b641b1 100644 --- a/Library/Homebrew/cask/dsl/depends_on.rb +++ b/Library/Homebrew/cask/dsl/depends_on.rb @@ -13,9 +13,9 @@ module Cask ].freeze VALID_ARCHES = { - intel: { type: :intel, bits: 64 }, + intel: { type: :intel, bits: 64 }, # specific - x86_64: { type: :intel, bits: 64 }, + x86_64: { type: :intel, bits: 64 }, }.freeze attr_accessor :java diff --git a/Library/Homebrew/cask/dsl/version.rb b/Library/Homebrew/cask/dsl/version.rb index 8941854fe3..b2c9c23ded 100644 --- a/Library/Homebrew/cask/dsl/version.rb +++ b/Library/Homebrew/cask/dsl/version.rb @@ -8,9 +8,9 @@ module Cask "/" => :slashes, }.freeze - DIVIDER_REGEX = /(#{DIVIDERS.keys.map { |v| Regexp.quote(v) }.join('|')})/ + DIVIDER_REGEX = /(#{DIVIDERS.keys.map { |v| Regexp.quote(v) }.join('|')})/.freeze - MAJOR_MINOR_PATCH_REGEX = /^(\d+)(?:\.(\d+)(?:\.(\d+))?)?/ + MAJOR_MINOR_PATCH_REGEX = /^(\d+)(?:\.(\d+)(?:\.(\d+))?)?/.freeze class << self private diff --git a/Library/Homebrew/cask/installer.rb b/Library/Homebrew/cask/installer.rb index 20609203fb..95d990ea74 100644 --- a/Library/Homebrew/cask/installer.rb +++ b/Library/Homebrew/cask/installer.rb @@ -322,10 +322,10 @@ module Cask not_installed.each do |cask| Installer.new( cask, - binaries: binaries?, - verbose: verbose?, + binaries: binaries?, + verbose: verbose?, installed_as_dependency: true, - force: false, + force: false, ).install end end diff --git a/Library/Homebrew/cask/pkg.rb b/Library/Homebrew/cask/pkg.rb index b8b37c114e..070dd197dd 100644 --- a/Library/Homebrew/cask/pkg.rb +++ b/Library/Homebrew/cask/pkg.rb @@ -18,11 +18,11 @@ module Cask odebug "Deleting pkg files" @command.run!( "/usr/bin/xargs", - args: [ + args: [ "-0", "--", "/bin/rm", "--" ], input: pkgutil_bom_files.join("\0"), - sudo: true, + sudo: true, ) end @@ -30,11 +30,11 @@ module Cask odebug "Deleting pkg symlinks and special files" @command.run!( "/usr/bin/xargs", - args: [ + args: [ "-0", "--", "/bin/rm", "--" ], input: pkgutil_bom_specials.join("\0"), - sudo: true, + sudo: true, ) end diff --git a/Library/Homebrew/cask/quarantine.rb b/Library/Homebrew/cask/quarantine.rb index 5772388fce..7cddb7b33d 100644 --- a/Library/Homebrew/cask/quarantine.rb +++ b/Library/Homebrew/cask/quarantine.rb @@ -28,7 +28,7 @@ module Cask :no_swift else api_check = system_command(swift, - args: [QUARANTINE_SCRIPT], + args: [QUARANTINE_SCRIPT], print_stderr: false) case api_check.exit_status @@ -87,7 +87,7 @@ module Cask odebug "Releasing #{download_path} from quarantine" quarantiner = system_command(xattr, - args: [ + args: [ "-d", QUARANTINE_ATTRIBUTE, download_path, @@ -107,7 +107,7 @@ module Cask odebug "Quarantining #{download_path}" quarantiner = system_command(swift, - args: [ + args: [ QUARANTINE_SCRIPT, download_path, cask.url.to_s, @@ -137,7 +137,7 @@ module Cask resolved_paths = Pathname.glob(to/"**/*", File::FNM_DOTMATCH) system_command!("/usr/bin/xargs", - args: [ + args: [ "-0", "--", "/bin/chmod", @@ -147,7 +147,7 @@ module Cask input: resolved_paths.join("\0")) quarantiner = system_command("/usr/bin/xargs", - args: [ + args: [ "-0", "--", xattr, @@ -156,7 +156,7 @@ module Cask QUARANTINE_ATTRIBUTE, quarantine_status, ], - input: resolved_paths.join("\0"), + input: resolved_paths.join("\0"), print_stderr: false) return if quarantiner.success? diff --git a/Library/Homebrew/cleanup.rb b/Library/Homebrew/cleanup.rb index 432efa2a38..3ab5645c4f 100644 --- a/Library/Homebrew/cleanup.rb +++ b/Library/Homebrew/cleanup.rb @@ -354,7 +354,7 @@ module Homebrew end dirs.select(&:directory?).each.parallel do |dir| system_command "find", - args: [dir, "-name", ".DS_Store", "-delete"], + args: [dir, "-name", ".DS_Store", "-delete"], print_stderr: false end end diff --git a/Library/Homebrew/cli_parser.rb b/Library/Homebrew/cli_parser.rb index 352d6405aa..64b1eba481 100644 --- a/Library/Homebrew/cli_parser.rb +++ b/Library/Homebrew/cli_parser.rb @@ -13,10 +13,10 @@ module Homebrew def self.global_options { - quiet: [["-q", "--quiet"], :quiet, "Suppress any warnings."], + quiet: [["-q", "--quiet"], :quiet, "Suppress any warnings."], verbose: [["-v", "--verbose"], :verbose, "Make some output more verbose."], - debug: [["-d", "--debug"], :debug, "Display any debugging information."], - force: [["-f", "--force"], :force, "Override warnings and enable potentially unsafe operations."], + debug: [["-d", "--debug"], :debug, "Display any debugging information."], + force: [["-f", "--force"], :force, "Override warnings and enable potentially unsafe operations."], } end diff --git a/Library/Homebrew/cmd/deps.rb b/Library/Homebrew/cmd/deps.rb index c947d8ac14..0a40137e3f 100644 --- a/Library/Homebrew/cmd/deps.rb +++ b/Library/Homebrew/cmd/deps.rb @@ -60,12 +60,12 @@ module Homebrew def deps mode = OpenStruct.new( - installed?: ARGV.include?("--installed"), - tree?: ARGV.include?("--tree"), - all?: ARGV.include?("--all"), + installed?: ARGV.include?("--installed"), + tree?: ARGV.include?("--tree"), + all?: ARGV.include?("--all"), topo_order?: ARGV.include?("-n"), - union?: ARGV.include?("--union"), - for_each?: ARGV.include?("--for-each"), + union?: ARGV.include?("--union"), + for_each?: ARGV.include?("--for-each"), ) if mode.tree? diff --git a/Library/Homebrew/cmd/outdated.rb b/Library/Homebrew/cmd/outdated.rb index 3b4f1f0e68..1a6dcda0b1 100644 --- a/Library/Homebrew/cmd/outdated.rb +++ b/Library/Homebrew/cmd/outdated.rb @@ -87,11 +87,11 @@ module Homebrew f.pkg_version.to_s end - json << { name: f.full_name, + json << { name: f.full_name, installed_versions: outdated_versions.map(&:to_s), - current_version: current_version, - pinned: f.pinned?, - pinned_version: f.pinned_version } + current_version: current_version, + pinned: f.pinned?, + pinned_version: f.pinned_version } end puts JSON.generate(json) diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb index c95eb2b376..1bfde8f662 100644 --- a/Library/Homebrew/cmd/search.rb +++ b/Library/Homebrew/cmd/search.rb @@ -33,10 +33,10 @@ module Homebrew fink: ->(query) { "http://pdb.finkproject.org/pdb/browse.php?summary=#{query}" }, opensuse: ->(query) { "https://software.opensuse.org/search?q=#{query}" }, fedora: ->(query) { "https://apps.fedoraproject.org/packages/s/#{query}" }, - debian: lambda { |query| + debian: lambda { |query| "https://packages.debian.org/search?keywords=#{query}&searchon=names&suite=all§ion=all" }, - ubuntu: lambda { |query| + ubuntu: lambda { |query| "https://packages.ubuntu.com/search?keywords=#{query}&searchon=names&suite=all§ion=all" }, }.freeze diff --git a/Library/Homebrew/cmd/tap.rb b/Library/Homebrew/cmd/tap.rb index 9539faee61..c775a536f2 100644 --- a/Library/Homebrew/cmd/tap.rb +++ b/Library/Homebrew/cmd/tap.rb @@ -45,10 +45,10 @@ module Homebrew else tap = Tap.fetch(ARGV.named.first) begin - tap.install clone_target: ARGV.named.second, + tap.install clone_target: ARGV.named.second, force_auto_update: force_auto_update?, - full_clone: full_clone?, - quiet: ARGV.quieter? + full_clone: full_clone?, + quiet: ARGV.quieter? rescue TapRemoteMismatchError => e odie e rescue TapAlreadyTappedError, TapAlreadyUnshallowError # rubocop:disable Lint/HandleExceptions diff --git a/Library/Homebrew/cmd/update-report.rb b/Library/Homebrew/cmd/update-report.rb index 86fbff79df..ff27596384 100644 --- a/Library/Homebrew/cmd/update-report.rb +++ b/Library/Homebrew/cmd/update-report.rb @@ -84,8 +84,8 @@ module Homebrew end out, _, status = system_command("git", - args: ["describe", "--tags", "--abbrev=0", initial_revision], - chdir: HOMEBREW_REPOSITORY, + args: ["describe", "--tags", "--abbrev=0", initial_revision], + chdir: HOMEBREW_REPOSITORY, print_stderr: false) initial_version = Version.new(out) if status.success? diff --git a/Library/Homebrew/compilers.rb b/Library/Homebrew/compilers.rb index ae86a96fad..0c360393e8 100644 --- a/Library/Homebrew/compilers.rb +++ b/Library/Homebrew/compilers.rb @@ -1,7 +1,7 @@ # @private module CompilerConstants GNU_GCC_VERSIONS = %w[4.4 4.5 4.6 4.7 4.8 4.9 5 6 7 8].freeze - GNU_GCC_REGEXP = /^gcc-(4\.[4-9]|[5-8])$/ + GNU_GCC_REGEXP = /^gcc-(4\.[4-9]|[5-8])$/.freeze COMPILER_SYMBOL_MAP = { "gcc" => :gcc, "gcc-4.0" => :gcc_4_0, @@ -67,7 +67,7 @@ class CompilerFailure end COLLECTIONS = { - cxx11: [ + cxx11: [ create(:gcc_4_0), create(:gcc_4_2), create(:clang) { build 425 }, @@ -75,7 +75,7 @@ class CompilerFailure create(gcc: "4.5"), create(gcc: "4.6"), ], - cxx14: [ + cxx14: [ create(:clang) { build 600 }, create(:gcc_4_0), create(:gcc_4_2), @@ -97,10 +97,10 @@ class CompilerSelector Compiler = Struct.new(:name, :version) COMPILER_PRIORITY = { - clang: [:clang, :gcc_4_2, :gnu, :gcc_4_0, :llvm_clang], + clang: [:clang, :gcc_4_2, :gnu, :gcc_4_0, :llvm_clang], gcc_4_2: [:gcc_4_2, :gnu, :clang, :gcc_4_0], gcc_4_0: [:gcc_4_0, :gcc_4_2, :gnu, :clang], - gcc: [:gnu, :gcc, :llvm_clang, :clang, :gcc_4_2, :gcc_4_0], + gcc: [:gnu, :gcc, :llvm_clang, :clang, :gcc_4_2, :gcc_4_0], }.freeze def self.select_for(formula, compilers = self.compilers) diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index ae0fc99714..cbb3da0c99 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -556,9 +556,9 @@ module Homebrew return unless DevelopmentTools.curl_handles_most_https_certificates? if http_content_problem = curl_check_http_content(homepage, - user_agents: [:browser, :default], + user_agents: [:browser, :default], check_content: true, - strict: @strict) + strict: @strict) problem http_content_problem end end diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb index f25cf9efe6..4b50b2e1e6 100644 --- a/Library/Homebrew/dev-cmd/bottle.rb +++ b/Library/Homebrew/dev-cmd/bottle.rb @@ -99,11 +99,11 @@ module Homebrew "formula file. Instead of a formula name, requires a JSON file generated with "\ "`brew bottle --json` ." switch "--write", - depends_on: "--merge", + depends_on: "--merge", description: "Write the changes to the formula file. A new commit will be generated unless "\ "`--no-commit` is passed." switch "--no-commit", - depends_on: "--write", + depends_on: "--write", description: "When passed with `--write`, a new commit will not generated after writing changes "\ "to the formula file." flag "--root-url=", @@ -420,23 +420,23 @@ module Homebrew f.full_name => { "formula" => { "pkg_version" => f.pkg_version.to_s, - "path" => f.path.to_s.delete_prefix("#{HOMEBREW_REPOSITORY}/"), + "path" => f.path.to_s.delete_prefix("#{HOMEBREW_REPOSITORY}/"), }, - "bottle" => { + "bottle" => { "root_url" => bottle.root_url, - "prefix" => bottle.prefix, - "cellar" => bottle.cellar.to_s, - "rebuild" => bottle.rebuild, - "tags" => { + "prefix" => bottle.prefix, + "cellar" => bottle.cellar.to_s, + "rebuild" => bottle.rebuild, + "tags" => { tag => { - "filename" => filename.bintray, + "filename" => filename.bintray, "local_filename" => filename.to_s, - "sha256" => sha256, + "sha256" => sha256, }, }, }, "bintray" => { - "package" => Utils::Bottles::Bintray.package(f.name), + "package" => Utils::Bottles::Bintray.package(f.name), "repository" => Utils::Bottles::Bintray.repository(tap), }, }, diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb index 46c56ccd9f..95d64c0202 100644 --- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb @@ -71,7 +71,7 @@ module Homebrew switch "-n", "--dry-run", description: "Print what would be done rather than doing it." switch "--write", - depends_on: "--dry-run", + depends_on: "--dry-run", description: "When passed along with `--dry-run`, perform a not-so-dry run by making the expected "\ "file modifications but not taking any Git actions." switch "--no-audit", @@ -92,13 +92,13 @@ module Homebrew description: "Specify the for the new download. If a is specified, the "\ "checksum of the new download should also be specified." flag "--sha256=", - depends_on: "--url=", + depends_on: "--url=", description: "Specify the checksum of the new download." flag "--tag=", description: "Specify the new git commit for the formula." flag "--revision=", required_for: "--tag=", - description: "Specify the new git commit corresponding to a specified ." + description: "Specify the new git commit corresponding to a specified ." switch :force switch :quiet diff --git a/Library/Homebrew/dev-cmd/irb.rb b/Library/Homebrew/dev-cmd/irb.rb index b001a89182..62bd270e9d 100644 --- a/Library/Homebrew/dev-cmd/irb.rb +++ b/Library/Homebrew/dev-cmd/irb.rb @@ -33,7 +33,7 @@ module Homebrew switch "--examples", description: "Show several examples." switch "--pry", - env: :pry, + env: :pry, description: "Use Pry instead of IRB. Implied if `HOMEBREW_PRY` is set." end end diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 399b0080d4..8014bcdcb8 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -53,9 +53,9 @@ class AbstractDownloadStrategy UnpackStrategy.detect(cached_location, extension_only: true, ref_type: @ref_type, ref: @ref) - .extract_nestedly(basename: basename, + .extract_nestedly(basename: basename, extension_only: true, - verbose: ARGV.verbose? && !shutup) + verbose: ARGV.verbose? && !shutup) chdir end @@ -99,8 +99,8 @@ class AbstractDownloadStrategy *args, print_stdout: !shutup, print_stderr: !shutup, - verbose: ARGV.verbose? && !shutup, - env: env, + verbose: ARGV.verbose? && !shutup, + env: env, **options, ) end @@ -464,7 +464,7 @@ class NoUnzipCurlDownloadStrategy < CurlDownloadStrategy def stage UnpackStrategy::Uncompressed.new(cached_location) .extract(basename: basename, - verbose: ARGV.verbose? && !shutup) + verbose: ARGV.verbose? && !shutup) end end @@ -666,10 +666,10 @@ class GitDownloadStrategy < VCSDownloadStrategy def config_repo system_command! "git", - args: ["config", "remote.origin.url", @url], + args: ["config", "remote.origin.url", @url], chdir: cached_location system_command! "git", - args: ["config", "remote.origin.fetch", refspec], + args: ["config", "remote.origin.fetch", refspec], chdir: cached_location end @@ -678,11 +678,11 @@ class GitDownloadStrategy < VCSDownloadStrategy if !shallow_clone? && shallow_dir? system_command! "git", - args: ["fetch", "origin", "--unshallow"], + args: ["fetch", "origin", "--unshallow"], chdir: cached_location else system_command! "git", - args: ["fetch", "origin"], + args: ["fetch", "origin"], chdir: cached_location end end @@ -691,7 +691,7 @@ class GitDownloadStrategy < VCSDownloadStrategy system_command! "git", args: clone_args system_command! "git", - args: ["config", "homebrew.cacheversion", cache_version], + args: ["config", "homebrew.cacheversion", cache_version], chdir: cached_location checkout update_submodules if submodules? @@ -711,16 +711,16 @@ class GitDownloadStrategy < VCSDownloadStrategy end system_command! "git", - args: ["reset", "--hard", *ref], + args: ["reset", "--hard", *ref], chdir: cached_location end def update_submodules system_command! "git", - args: ["submodule", "foreach", "--recursive", "git submodule sync"], + args: ["submodule", "foreach", "--recursive", "git submodule sync"], chdir: cached_location system_command! "git", - args: ["submodule", "update", "--init", "--recursive"], + args: ["submodule", "update", "--init", "--recursive"], chdir: cached_location fix_absolute_submodule_gitdir_references! end @@ -734,7 +734,7 @@ class GitDownloadStrategy < VCSDownloadStrategy # See https://github.com/Homebrew/homebrew-core/pull/1520 for an example. def fix_absolute_submodule_gitdir_references! submodule_dirs = system_command!("git", - args: ["submodule", "--quiet", "foreach", "--recursive", "pwd"], + args: ["submodule", "--quiet", "foreach", "--recursive", "pwd"], chdir: cached_location).stdout submodule_dirs.lines.map(&:chomp).each do |submodule_dir| @@ -867,13 +867,13 @@ class CVSDownloadStrategy < VCSDownloadStrategy system_command! "cvs", args: [*quiet_flag, "-d", @url, "login"] if @url.include? "pserver" system_command! "cvs", - args: [*quiet_flag, "-d", @url, "checkout", "-d", cached_location.basename, @module], + args: [*quiet_flag, "-d", @url, "checkout", "-d", cached_location.basename, @module], chdir: cached_location.dirname end def update system_command! "cvs", - args: [*quiet_flag, "update"], + args: [*quiet_flag, "update"], chdir: cached_location end @@ -958,7 +958,7 @@ class BazaarDownloadStrategy < VCSDownloadStrategy def env { - "PATH" => PATH.new(Formula["bazaar"].opt_bin, ENV["PATH"]), + "PATH" => PATH.new(Formula["bazaar"].opt_bin, ENV["PATH"]), "BZR_HOME" => HOMEBREW_TEMP, } end @@ -979,7 +979,7 @@ class BazaarDownloadStrategy < VCSDownloadStrategy def update system_command! "bzr", - args: ["update"], + args: ["update"], chdir: cached_location end end diff --git a/Library/Homebrew/extend/os/mac/hardware/cpu.rb b/Library/Homebrew/extend/os/mac/hardware/cpu.rb index a3c3df8f03..986cf637e5 100644 --- a/Library/Homebrew/extend/os/mac/hardware/cpu.rb +++ b/Library/Homebrew/extend/os/mac/hardware/cpu.rb @@ -5,10 +5,10 @@ module Hardware features, sse4? PPC_OPTIMIZATION_FLAGS = { - g3: "-mcpu=750", - g4: "-mcpu=7400", - g4e: "-mcpu=7450", - g5: "-mcpu=970", + g3: "-mcpu=750", + g4: "-mcpu=7400", + g4e: "-mcpu=7450", + g5: "-mcpu=970", g5_64: "-mcpu=970 -arch ppc64", }.freeze diff --git a/Library/Homebrew/extend/os/mac/keg_relocate.rb b/Library/Homebrew/extend/os/mac/keg_relocate.rb index 9a50e540ba..77c8a4ca31 100644 --- a/Library/Homebrew/extend/os/mac/keg_relocate.rb +++ b/Library/Homebrew/extend/os/mac/keg_relocate.rb @@ -111,7 +111,7 @@ class Keg # Matches framework references like `XXX.framework/Versions/YYY/XXX` and # `XXX.framework/XXX`, both with or without a slash-delimited prefix. - FRAMEWORK_RX = %r{(?:^|/)(([^/]+)\.framework/(?:Versions/[^/]+/)?\2)$} + FRAMEWORK_RX = %r{(?:^|/)(([^/]+)\.framework/(?:Versions/[^/]+/)?\2)$}.freeze def find_dylib_suffix_from(bad_name) if (framework = bad_name.match(FRAMEWORK_RX)) diff --git a/Library/Homebrew/extend/os/mac/unpack_strategy/zip.rb b/Library/Homebrew/extend/os/mac/unpack_strategy/zip.rb index 2d0b4618a1..56b7201081 100644 --- a/Library/Homebrew/extend/os/mac/unpack_strategy/zip.rb +++ b/Library/Homebrew/extend/os/mac/unpack_strategy/zip.rb @@ -13,8 +13,8 @@ module UnpackStrategy # Merge ._ files back into extended attributes. # ._ files inside volumes are automatically merged by ditto. system_command!("dot_clean", - args: ["-mv", "--keep=dotbar", unpack_dir], - verbose: verbose, + args: ["-mv", "--keep=dotbar", unpack_dir], + verbose: verbose, print_stderr: false) end @@ -26,7 +26,7 @@ module UnpackStrategy # `ditto` keeps Finder attributes intact and does not skip volume labels # like `unzip` does, which can prevent disk images from being unzipped. system_command! "ditto", - args: ["-x", "-k", path, tmp_unpack_dir], + args: ["-x", "-k", path, tmp_unpack_dir], verbose: verbose volumes.each do |volume| diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index 513e112908..c1bc4eb203 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -70,7 +70,7 @@ class Pathname include DiskUsageExtension # @private - BOTTLE_EXTNAME_RX = /(\.[a-z0-9_]+\.bottle\.(\d+\.)?tar\.gz)$/ + BOTTLE_EXTNAME_RX = /(\.[a-z0-9_]+\.bottle\.(\d+\.)?tar\.gz)$/.freeze # Moves a file from the original location to the {Pathname}'s. def install(*sources) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 655eca1860..a3d1d41c83 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -335,7 +335,7 @@ class Formula :bottled?, :bottle_specification, :downloader, - ] => :active_spec + ] => :active_spec # The Bottle object for the currently active {SoftwareSpec}. # @private @@ -994,11 +994,11 @@ class Formula self.build = Tab.for_formula(self) new_env = { - "TMPDIR" => HOMEBREW_TEMP, - "TEMP" => HOMEBREW_TEMP, - "TMP" => HOMEBREW_TEMP, + "TMPDIR" => HOMEBREW_TEMP, + "TEMP" => HOMEBREW_TEMP, + "TMP" => HOMEBREW_TEMP, "HOMEBREW_PATH" => nil, - "PATH" => ENV["HOMEBREW_PATH"], + "PATH" => ENV["HOMEBREW_PATH"], } with_env(new_env) do @@ -1569,7 +1569,7 @@ class Formula def runtime_formula_dependencies(read_from_tab: true, undeclared: true) runtime_dependencies( read_from_tab: read_from_tab, - undeclared: undeclared, + undeclared: undeclared, ).map do |d| begin d.to_formula @@ -1597,35 +1597,35 @@ class Formula dependencies = deps hsh = { - "name" => name, - "full_name" => full_name, - "oldname" => oldname, - "aliases" => aliases.sort, - "versioned_formulae" => versioned_formulae.map(&:name), - "desc" => desc, - "homepage" => homepage, - "versions" => { + "name" => name, + "full_name" => full_name, + "oldname" => oldname, + "aliases" => aliases.sort, + "versioned_formulae" => versioned_formulae.map(&:name), + "desc" => desc, + "homepage" => homepage, + "versions" => { "stable" => stable&.version&.to_s, - "devel" => devel&.version&.to_s, - "head" => head&.version&.to_s, + "devel" => devel&.version&.to_s, + "head" => head&.version&.to_s, "bottle" => !bottle_specification.checksums.empty?, }, - "revision" => revision, - "version_scheme" => version_scheme, - "bottle" => {}, - "keg_only" => keg_only?, - "options" => [], - "build_dependencies" => dependencies.select(&:build?).map(&:name).uniq, - "dependencies" => dependencies.reject(&:optional?).reject(&:recommended?).reject(&:build?).map(&:name).uniq, + "revision" => revision, + "version_scheme" => version_scheme, + "bottle" => {}, + "keg_only" => keg_only?, + "options" => [], + "build_dependencies" => dependencies.select(&:build?).map(&:name).uniq, + "dependencies" => dependencies.reject(&:optional?).reject(&:recommended?).reject(&:build?).map(&:name).uniq, "recommended_dependencies" => dependencies.select(&:recommended?).map(&:name).uniq, - "optional_dependencies" => dependencies.select(&:optional?).map(&:name).uniq, - "requirements" => [], - "conflicts_with" => conflicts.map(&:name), - "caveats" => caveats, - "installed" => [], - "linked_keg" => linked_version&.to_s, - "pinned" => pinned?, - "outdated" => outdated?, + "optional_dependencies" => dependencies.select(&:optional?).map(&:name).uniq, + "requirements" => [], + "conflicts_with" => conflicts.map(&:name), + "caveats" => caveats, + "installed" => [], + "linked_keg" => linked_version&.to_s, + "pinned" => pinned?, + "outdated" => outdated?, } %w[stable devel].each do |spec_sym| @@ -1634,16 +1634,16 @@ class Formula bottle_spec = spec.bottle_specification bottle_info = { - "rebuild" => bottle_spec.rebuild, - "cellar" => (cellar = bottle_spec.cellar).is_a?(Symbol) ? cellar.inspect : cellar, - "prefix" => bottle_spec.prefix, + "rebuild" => bottle_spec.rebuild, + "cellar" => (cellar = bottle_spec.cellar).is_a?(Symbol) ? cellar.inspect : cellar, + "prefix" => bottle_spec.prefix, "root_url" => bottle_spec.root_url, } bottle_info["files"] = {} bottle_spec.collector.keys.each do |os| checksum = bottle_spec.collector[os] bottle_info["files"][os] = { - "url" => "#{bottle_spec.root_url}/#{Bottle::Filename.create(self, os, bottle_spec.rebuild).bintray}", + "url" => "#{bottle_spec.root_url}/#{Bottle::Filename.create(self, os, bottle_spec.rebuild).bintray}", checksum.hash_type.to_s => checksum.hexdigest, } end @@ -1656,8 +1656,8 @@ class Formula hsh["requirements"] = requirements.map do |req| { - "name" => req.name, - "cask" => req.cask, + "name" => req.name, + "cask" => req.cask, "download" => req.download, } end @@ -1666,13 +1666,13 @@ class Formula tab = Tab.for_keg keg hsh["installed"] << { - "version" => keg.version.to_s, - "used_options" => tab.used_options.as_flags, - "built_as_bottle" => tab.built_as_bottle, - "poured_from_bottle" => tab.poured_from_bottle, - "runtime_dependencies" => tab.runtime_dependencies, + "version" => keg.version.to_s, + "used_options" => tab.used_options.as_flags, + "built_as_bottle" => tab.built_as_bottle, + "poured_from_bottle" => tab.poured_from_bottle, + "runtime_dependencies" => tab.runtime_dependencies, "installed_as_dependency" => tab.installed_as_dependency, - "installed_on_request" => tab.installed_on_request, + "installed_on_request" => tab.installed_on_request, } end @@ -1696,16 +1696,16 @@ class Formula @prefix_returns_versioned_prefix = true test_env = { - CURL_HOME: ENV["CURL_HOME"] || ENV["HOME"], - TMPDIR: HOMEBREW_TEMP, - TEMP: HOMEBREW_TEMP, - TMP: HOMEBREW_TEMP, - TERM: "dumb", - PATH: PATH.new(ENV["PATH"], HOMEBREW_PREFIX/"bin"), + CURL_HOME: ENV["CURL_HOME"] || ENV["HOME"], + TMPDIR: HOMEBREW_TEMP, + TEMP: HOMEBREW_TEMP, + TMP: HOMEBREW_TEMP, + TERM: "dumb", + PATH: PATH.new(ENV["PATH"], HOMEBREW_PREFIX/"bin"), HOMEBREW_PATH: nil, _JAVA_OPTIONS: "#{ENV["_JAVA_OPTIONS"]} -Duser.home=#{HOMEBREW_CACHE}/java_cache", - GOCACHE: "#{HOMEBREW_CACHE}/go_cache", - CARGO_HOME: "#{HOMEBREW_CACHE}/cargo_cache", + GOCACHE: "#{HOMEBREW_CACHE}/go_cache", + CARGO_HOME: "#{HOMEBREW_CACHE}/cargo_cache", } ENV.clear_sensitive_environment! @@ -1841,7 +1841,7 @@ class Formula @exec_count += 1 logfn = format("#{logs}/#{active_log_prefix}%02d.%{cmd_base}", exec_count: @exec_count, - cmd_base: File.basename(cmd).split(" ").first) + cmd_base: File.basename(cmd).split(" ").first) logs.mkpath File.open(logfn, "w") do |log| diff --git a/Library/Homebrew/formula_versions.rb b/Library/Homebrew/formula_versions.rb index 3de594eaaa..c4248fbdf5 100644 --- a/Library/Homebrew/formula_versions.rb +++ b/Library/Homebrew/formula_versions.rb @@ -92,7 +92,7 @@ class FormulaVersions attributes.each do |attribute| attributes_map[attribute] ||= { stable: {}, - devel: {}, + devel: {}, } end diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb index da3c600332..e2d51f2194 100644 --- a/Library/Homebrew/global.rb +++ b/Library/Homebrew/global.rb @@ -104,8 +104,8 @@ module Homebrew end end -HOMEBREW_PULL_API_REGEX = %r{https://api\.github\.com/repos/([\w-]+)/([\w-]+)?/pulls/(\d+)} -HOMEBREW_PULL_OR_COMMIT_URL_REGEX = %r[https://github\.com/([\w-]+)/([\w-]+)?/(?:pull/(\d+)|commit/[0-9a-fA-F]{4,40})] +HOMEBREW_PULL_API_REGEX = %r{https://api\.github\.com/repos/([\w-]+)/([\w-]+)?/pulls/(\d+)}.freeze +HOMEBREW_PULL_OR_COMMIT_URL_REGEX = %r[https://github\.com/([\w-]+)/([\w-]+)?/(?:pull/(\d+)|commit/[0-9a-fA-F]{4,40})].freeze require "forwardable" require "PATH" @@ -120,22 +120,22 @@ ORIGINAL_PATHS = PATH.new(ENV["HOMEBREW_PATH"]).map do |p| end.compact.freeze HOMEBREW_INTERNAL_COMMAND_ALIASES = { - "ls" => "list", - "homepage" => "home", - "-S" => "search", - "up" => "update", - "ln" => "link", - "instal" => "install", # gem does the same - "uninstal" => "uninstall", - "rm" => "uninstall", - "remove" => "uninstall", - "configure" => "diy", - "abv" => "info", - "dr" => "doctor", - "--repo" => "--repository", + "ls" => "list", + "homepage" => "home", + "-S" => "search", + "up" => "update", + "ln" => "link", + "instal" => "install", # gem does the same + "uninstal" => "uninstall", + "rm" => "uninstall", + "remove" => "uninstall", + "configure" => "diy", + "abv" => "info", + "dr" => "doctor", + "--repo" => "--repository", "environment" => "--env", - "--config" => "config", - "-v" => "--version", + "--config" => "config", + "-v" => "--version", }.freeze require "set" diff --git a/Library/Homebrew/hardware.rb b/Library/Homebrew/hardware.rb index f087161469..9a8a10f546 100644 --- a/Library/Homebrew/hardware.rb +++ b/Library/Homebrew/hardware.rb @@ -8,7 +8,7 @@ module Hardware class << self OPTIMIZATION_FLAGS = { core2: "-march=core2", - core: "-march=prescott", + core: "-march=prescott", armv6: "-march=armv6", armv8: "-march=armv8-a", }.freeze diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb index d36faf5a0a..63098cc774 100644 --- a/Library/Homebrew/keg.rb +++ b/Library/Homebrew/keg.rb @@ -63,8 +63,8 @@ class Keg end # locale-specific directories have the form language[_territory][.codeset][@modifier] - LOCALEDIR_RX = %r{(locale|man)/([a-z]{2}|C|POSIX)(_[A-Z]{2})?(\.[a-zA-Z\-0-9]+(@.+)?)?} - INFOFILE_RX = %r{info/([^.].*?\.info|dir)$} + LOCALEDIR_RX = %r{(locale|man)/([a-z]{2}|C|POSIX)(_[A-Z]{2})?(\.[a-zA-Z\-0-9]+(@.+)?)?}.freeze + INFOFILE_RX = %r{info/([^.].*?\.info|dir)$}.freeze KEG_LINK_DIRECTORIES = %w[ bin etc include lib sbin share var ].freeze diff --git a/Library/Homebrew/keg_relocate.rb b/Library/Homebrew/keg_relocate.rb index 89bad8c3fb..9936ecbe2e 100644 --- a/Library/Homebrew/keg_relocate.rb +++ b/Library/Homebrew/keg_relocate.rb @@ -34,11 +34,11 @@ class Keg def replace_locations_with_placeholders relocation = Relocation.new( - old_prefix: HOMEBREW_PREFIX.to_s, - old_cellar: HOMEBREW_CELLAR.to_s, + old_prefix: HOMEBREW_PREFIX.to_s, + old_cellar: HOMEBREW_CELLAR.to_s, old_repository: HOMEBREW_REPOSITORY.to_s, - new_prefix: PREFIX_PLACEHOLDER, - new_cellar: CELLAR_PLACEHOLDER, + new_prefix: PREFIX_PLACEHOLDER, + new_cellar: CELLAR_PLACEHOLDER, new_repository: REPOSITORY_PLACEHOLDER, ) relocate_dynamic_linkage(relocation) @@ -47,11 +47,11 @@ class Keg def replace_placeholders_with_locations(files, skip_linkage: false) relocation = Relocation.new( - old_prefix: PREFIX_PLACEHOLDER, - old_cellar: CELLAR_PLACEHOLDER, + old_prefix: PREFIX_PLACEHOLDER, + old_cellar: CELLAR_PLACEHOLDER, old_repository: REPOSITORY_PLACEHOLDER, - new_prefix: HOMEBREW_PREFIX.to_s, - new_cellar: HOMEBREW_CELLAR.to_s, + new_prefix: HOMEBREW_PREFIX.to_s, + new_cellar: HOMEBREW_CELLAR.to_s, new_repository: HOMEBREW_REPOSITORY.to_s, ) relocate_dynamic_linkage(relocation) unless skip_linkage @@ -66,8 +66,8 @@ class Keg s = first.open("rb", &:read) replacements = { - relocation.old_prefix => relocation.new_prefix, - relocation.old_cellar => relocation.new_cellar, + relocation.old_prefix => relocation.new_prefix, + relocation.old_cellar => relocation.new_cellar, relocation.old_repository => relocation.new_repository, } changed = s.gsub!(Regexp.union(replacements.keys.sort_by(&:length).reverse), replacements) diff --git a/Library/Homebrew/locale.rb b/Library/Homebrew/locale.rb index 8b194d568f..79f863c047 100644 --- a/Library/Homebrew/locale.rb +++ b/Library/Homebrew/locale.rb @@ -2,11 +2,11 @@ class Locale class ParserError < StandardError end - LANGUAGE_REGEX = /(?:[a-z]{2,3})/ # ISO 639-1 or ISO 639-2 - REGION_REGEX = /(?:[A-Z]{2}|\d{3})/ # ISO 3166-1 or UN M.49 - SCRIPT_REGEX = /(?:[A-Z][a-z]{3})/ # ISO 15924 + LANGUAGE_REGEX = /(?:[a-z]{2,3})/.freeze # ISO 639-1 or ISO 639-2 + REGION_REGEX = /(?:[A-Z]{2}|\d{3})/.freeze # ISO 3166-1 or UN M.49 + SCRIPT_REGEX = /(?:[A-Z][a-z]{3})/.freeze # ISO 15924 - LOCALE_REGEX = /\A((?:#{LANGUAGE_REGEX}|#{REGION_REGEX}|#{SCRIPT_REGEX})(?:\-|$)){1,3}\Z/ + LOCALE_REGEX = /\A((?:#{LANGUAGE_REGEX}|#{REGION_REGEX}|#{SCRIPT_REGEX})(?:\-|$)){1,3}\Z/.freeze def self.parse(string) string = string.to_s diff --git a/Library/Homebrew/official_taps.rb b/Library/Homebrew/official_taps.rb index a6c7b00fba..74059c908b 100644 --- a/Library/Homebrew/official_taps.rb +++ b/Library/Homebrew/official_taps.rb @@ -4,7 +4,7 @@ OFFICIAL_CASK_TAPS = %w[ ].freeze OFFICIAL_CMD_TAPS = { - "homebrew/bundle" => ["bundle"], + "homebrew/bundle" => ["bundle"], "homebrew/test-bot" => ["test-bot"], "homebrew/services" => ["services"], }.freeze diff --git a/Library/Homebrew/os/mac/version.rb b/Library/Homebrew/os/mac/version.rb index 8c9c4e39e6..213d402840 100644 --- a/Library/Homebrew/os/mac/version.rb +++ b/Library/Homebrew/os/mac/version.rb @@ -4,18 +4,18 @@ module OS module Mac class Version < ::Version SYMBOLS = { - mojave: "10.14", - high_sierra: "10.13", - sierra: "10.12", - el_capitan: "10.11", - yosemite: "10.10", - mavericks: "10.9", + mojave: "10.14", + high_sierra: "10.13", + sierra: "10.12", + el_capitan: "10.11", + yosemite: "10.10", + mavericks: "10.9", mountain_lion: "10.8", - lion: "10.7", - snow_leopard: "10.6", - leopard_64: "10.5", - leopard: "10.5", - tiger: "10.4", + lion: "10.7", + snow_leopard: "10.6", + leopard_64: "10.5", + leopard: "10.5", + tiger: "10.4", }.freeze def self.from_symbol(sym) diff --git a/Library/Homebrew/os/mac/xquartz.rb b/Library/Homebrew/os/mac/xquartz.rb index 8321d0ca37..27f30caa67 100644 --- a/Library/Homebrew/os/mac/xquartz.rb +++ b/Library/Homebrew/os/mac/xquartz.rb @@ -11,21 +11,21 @@ module OS FORGE_PKG_ID = "org.macosforge.xquartz.pkg".freeze PKGINFO_VERSION_MAP = { - "2.6.34" => "2.6.3", - "2.7.4" => "2.7.0", - "2.7.14" => "2.7.1", - "2.7.28" => "2.7.2", - "2.7.32" => "2.7.3", - "2.7.43" => "2.7.4", - "2.7.50" => "2.7.5_rc1", - "2.7.51" => "2.7.5_rc2", - "2.7.52" => "2.7.5_rc3", - "2.7.53" => "2.7.5_rc4", - "2.7.54" => "2.7.5", - "2.7.61" => "2.7.6", - "2.7.73" => "2.7.7", - "2.7.86" => "2.7.8", - "2.7.94" => "2.7.9", + "2.6.34" => "2.6.3", + "2.7.4" => "2.7.0", + "2.7.14" => "2.7.1", + "2.7.28" => "2.7.2", + "2.7.32" => "2.7.3", + "2.7.43" => "2.7.4", + "2.7.50" => "2.7.5_rc1", + "2.7.51" => "2.7.5_rc2", + "2.7.52" => "2.7.5_rc3", + "2.7.53" => "2.7.5_rc4", + "2.7.54" => "2.7.5", + "2.7.61" => "2.7.6", + "2.7.73" => "2.7.7", + "2.7.86" => "2.7.8", + "2.7.94" => "2.7.9", "2.7.108" => "2.7.10", "2.7.112" => "2.7.11", }.freeze diff --git a/Library/Homebrew/pkg_version.rb b/Library/Homebrew/pkg_version.rb index f138f764ce..8838a996af 100644 --- a/Library/Homebrew/pkg_version.rb +++ b/Library/Homebrew/pkg_version.rb @@ -3,7 +3,7 @@ require "version" class PkgVersion include Comparable - RX = /\A(.+?)(?:_(\d+))?\z/ + RX = /\A(.+?)(?:_(\d+))?\z/.freeze attr_reader :version, :revision diff --git a/Library/Homebrew/requirements/java_requirement.rb b/Library/Homebrew/requirements/java_requirement.rb index 9c6062f0a3..501129a249 100644 --- a/Library/Homebrew/requirements/java_requirement.rb +++ b/Library/Homebrew/requirements/java_requirement.rb @@ -58,7 +58,7 @@ class JavaRequirement < Requirement private JAVA_CASK_MAP = { - "1.8" => "homebrew/cask-versions/java8", + "1.8" => "homebrew/cask-versions/java8", "11.0" => "java", }.freeze diff --git a/Library/Homebrew/rubocops/class_cop.rb b/Library/Homebrew/rubocops/class_cop.rb index 0702e59fd5..c7aebd8a4e 100644 --- a/Library/Homebrew/rubocops/class_cop.rb +++ b/Library/Homebrew/rubocops/class_cop.rb @@ -54,7 +54,7 @@ module RuboCop corrector.remove( range_with_surrounding_comma( range_with_surrounding_space(range: node.source_range, - side: :left), + side: :left), ), ) end diff --git a/Library/Homebrew/search.rb b/Library/Homebrew/search.rb index c4da854000..61be354d61 100644 --- a/Library/Homebrew/search.rb +++ b/Library/Homebrew/search.rb @@ -37,9 +37,9 @@ module Homebrew matches = begin GitHub.search_code( - user: "Homebrew", - path: ["Formula", "Casks", "."], - filename: query, + user: "Homebrew", + path: ["Formula", "Casks", "."], + filename: query, extension: "rb", ) rescue GitHub::Error => error diff --git a/Library/Homebrew/system_config.rb b/Library/Homebrew/system_config.rb index f5ed7bd37c..dba2e8fb55 100644 --- a/Library/Homebrew/system_config.rb +++ b/Library/Homebrew/system_config.rb @@ -117,11 +117,11 @@ class SystemConfig f.puts "Core tap: N/A" end defaults_hash = { - HOMEBREW_PREFIX: Homebrew::DEFAULT_PREFIX, - HOMEBREW_REPOSITORY: Homebrew::DEFAULT_REPOSITORY, - HOMEBREW_CELLAR: Homebrew::DEFAULT_CELLAR, - HOMEBREW_CACHE: "#{ENV["HOME"]}/Library/Caches/Homebrew", - HOMEBREW_TEMP: ENV["HOMEBREW_SYSTEM_TEMP"], + HOMEBREW_PREFIX: Homebrew::DEFAULT_PREFIX, + HOMEBREW_REPOSITORY: Homebrew::DEFAULT_REPOSITORY, + HOMEBREW_CELLAR: Homebrew::DEFAULT_CELLAR, + HOMEBREW_CACHE: "#{ENV["HOME"]}/Library/Caches/Homebrew", + HOMEBREW_TEMP: ENV["HOMEBREW_SYSTEM_TEMP"], HOMEBREW_RUBY_WARNINGS: "-W0", }.freeze boring_keys = %w[ diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb index daac01b7e5..72bccb077d 100644 --- a/Library/Homebrew/tab.rb +++ b/Library/Homebrew/tab.rb @@ -19,29 +19,29 @@ class Tab < OpenStruct build = formula.build runtime_deps = formula.runtime_dependencies(undeclared: false) attributes = { - "homebrew_version" => HOMEBREW_VERSION, - "used_options" => build.used_options.as_flags, - "unused_options" => build.unused_options.as_flags, - "tabfile" => formula.prefix/FILENAME, - "built_as_bottle" => build.bottle?, + "homebrew_version" => HOMEBREW_VERSION, + "used_options" => build.used_options.as_flags, + "unused_options" => build.unused_options.as_flags, + "tabfile" => formula.prefix/FILENAME, + "built_as_bottle" => build.bottle?, "installed_as_dependency" => false, - "installed_on_request" => true, - "poured_from_bottle" => false, - "time" => Time.now.to_i, - "source_modified_time" => formula.source_modified_time.to_i, - "HEAD" => HOMEBREW_REPOSITORY.git_head, - "compiler" => compiler, - "stdlib" => stdlib, - "aliases" => formula.aliases, - "runtime_dependencies" => Tab.runtime_deps_hash(runtime_deps), - "source" => { - "path" => formula.specified_path.to_s, - "tap" => formula.tap&.name, - "spec" => formula.active_spec_sym.to_s, + "installed_on_request" => true, + "poured_from_bottle" => false, + "time" => Time.now.to_i, + "source_modified_time" => formula.source_modified_time.to_i, + "HEAD" => HOMEBREW_REPOSITORY.git_head, + "compiler" => compiler, + "stdlib" => stdlib, + "aliases" => formula.aliases, + "runtime_dependencies" => Tab.runtime_deps_hash(runtime_deps), + "source" => { + "path" => formula.specified_path.to_s, + "tap" => formula.tap&.name, + "spec" => formula.active_spec_sym.to_s, "versions" => { - "stable" => formula.stable&.version.to_s, - "devel" => formula.devel&.version.to_s, - "head" => formula.head&.version.to_s, + "stable" => formula.stable&.version.to_s, + "devel" => formula.devel&.version.to_s, + "head" => formula.head&.version.to_s, "version_scheme" => formula.version_scheme, }, }, @@ -88,9 +88,9 @@ class Tab < OpenStruct if attributes["source"]["versions"].nil? attributes["source"]["versions"] = { - "stable" => nil, - "devel" => nil, - "head" => nil, + "stable" => nil, + "devel" => nil, + "head" => nil, "version_scheme" => 0, } end @@ -158,13 +158,13 @@ class Tab < OpenStruct tab = empty tab.unused_options = f.options.as_flags tab.source = { - "path" => f.specified_path.to_s, - "tap" => f.tap&.name, - "spec" => f.active_spec_sym.to_s, + "path" => f.specified_path.to_s, + "tap" => f.tap&.name, + "spec" => f.active_spec_sym.to_s, "versions" => { - "stable" => f.stable&.version.to_s, - "devel" => f.devel&.version.to_s, - "head" => f.head&.version.to_s, + "stable" => f.stable&.version.to_s, + "devel" => f.devel&.version.to_s, + "head" => f.head&.version.to_s, "version_scheme" => f.version_scheme, }, } @@ -175,28 +175,28 @@ class Tab < OpenStruct def self.empty attributes = { - "homebrew_version" => HOMEBREW_VERSION, - "used_options" => [], - "unused_options" => [], - "built_as_bottle" => false, + "homebrew_version" => HOMEBREW_VERSION, + "used_options" => [], + "unused_options" => [], + "built_as_bottle" => false, "installed_as_dependency" => false, - "installed_on_request" => true, - "poured_from_bottle" => false, - "time" => nil, - "source_modified_time" => 0, - "HEAD" => nil, - "stdlib" => nil, - "compiler" => DevelopmentTools.default_compiler, - "aliases" => [], - "runtime_dependencies" => nil, - "source" => { - "path" => nil, - "tap" => nil, - "spec" => "stable", + "installed_on_request" => true, + "poured_from_bottle" => false, + "time" => nil, + "source_modified_time" => 0, + "HEAD" => nil, + "stdlib" => nil, + "compiler" => DevelopmentTools.default_compiler, + "aliases" => [], + "runtime_dependencies" => nil, + "source" => { + "path" => nil, + "tap" => nil, + "spec" => "stable", "versions" => { - "stable" => nil, - "devel" => nil, - "head" => nil, + "stable" => nil, + "devel" => nil, + "head" => nil, "version_scheme" => 0, }, }, @@ -330,22 +330,22 @@ class Tab < OpenStruct def to_json attributes = { - "homebrew_version" => homebrew_version, - "used_options" => used_options.as_flags, - "unused_options" => unused_options.as_flags, - "built_as_bottle" => built_as_bottle, - "poured_from_bottle" => poured_from_bottle, + "homebrew_version" => homebrew_version, + "used_options" => used_options.as_flags, + "unused_options" => unused_options.as_flags, + "built_as_bottle" => built_as_bottle, + "poured_from_bottle" => poured_from_bottle, "installed_as_dependency" => installed_as_dependency, - "installed_on_request" => installed_on_request, - "changed_files" => changed_files&.map(&:to_s), - "time" => time, - "source_modified_time" => source_modified_time.to_i, - "HEAD" => self.HEAD, - "stdlib" => (stdlib&.to_s), - "compiler" => (compiler&.to_s), - "aliases" => aliases, - "runtime_dependencies" => runtime_dependencies, - "source" => source, + "installed_on_request" => installed_on_request, + "changed_files" => changed_files&.map(&:to_s), + "time" => time, + "source_modified_time" => source_modified_time.to_i, + "HEAD" => self.HEAD, + "stdlib" => (stdlib&.to_s), + "compiler" => (compiler&.to_s), + "aliases" => aliases, + "runtime_dependencies" => runtime_dependencies, + "source" => source, } JSON.generate(attributes) diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb index 19c32aa57b..bf92a7d042 100644 --- a/Library/Homebrew/tap.rb +++ b/Library/Homebrew/tap.rb @@ -531,16 +531,16 @@ class Tap def to_hash hash = { - "name" => name, - "user" => user, - "repo" => repo, - "path" => path.to_s, - "installed" => installed?, - "official" => official?, + "name" => name, + "user" => user, + "repo" => repo, + "path" => path.to_s, + "installed" => installed?, + "official" => official?, "formula_names" => formula_names, "formula_files" => formula_files.map(&:to_s), "command_files" => command_files.map(&:to_s), - "pinned" => pinned?, + "pinned" => pinned?, } if installed? diff --git a/Library/Homebrew/tap_constants.rb b/Library/Homebrew/tap_constants.rb index 01d9998e22..749f36ca7a 100644 --- a/Library/Homebrew/tap_constants.rb +++ b/Library/Homebrew/tap_constants.rb @@ -1,10 +1,10 @@ # match taps' formulae, e.g. someuser/sometap/someformula -HOMEBREW_TAP_FORMULA_REGEX = %r{^([\w-]+)/([\w-]+)/([\w+-.@]+)$} +HOMEBREW_TAP_FORMULA_REGEX = %r{^([\w-]+)/([\w-]+)/([\w+-.@]+)$}.freeze # match taps' casks, e.g. someuser/sometap/somecask -HOMEBREW_TAP_CASK_REGEX = %r{^([\w-]+)/([\w-]+)/([a-z0-9\-]+)$} +HOMEBREW_TAP_CASK_REGEX = %r{^([\w-]+)/([\w-]+)/([a-z0-9\-]+)$}.freeze # match taps' directory paths, e.g. HOMEBREW_LIBRARY/Taps/someuser/sometap -HOMEBREW_TAP_DIR_REGEX = %r{#{Regexp.escape(HOMEBREW_LIBRARY)}/Taps/(?[\w-]+)/(?[\w-]+)} +HOMEBREW_TAP_DIR_REGEX = %r{#{Regexp.escape(HOMEBREW_LIBRARY)}/Taps/(?[\w-]+)/(?[\w-]+)}.freeze # match taps' formula paths, e.g. HOMEBREW_LIBRARY/Taps/someuser/sometap/someformula HOMEBREW_TAP_PATH_REGEX = Regexp.new(HOMEBREW_TAP_DIR_REGEX.source + %r{(?:/.*)?$}.source) # match official taps' casks, e.g. homebrew/cask/somecask or homebrew/cask-versions/somecask -HOMEBREW_CASK_TAP_CASK_REGEX = %r{^(?:([Cc]askroom)/(cask|versions)|(homebrew)/(cask|cask-[\w-]+))/([\w+-.]+)$} +HOMEBREW_CASK_TAP_CASK_REGEX = %r{^(?:([Cc]askroom)/(cask|versions)|(homebrew)/(cask|cask-[\w-]+))/([\w+-.]+)$}.freeze diff --git a/Library/Homebrew/test/cask/artifact/pkg_spec.rb b/Library/Homebrew/test/cask/artifact/pkg_spec.rb index be11a187ca..9d3cf6f711 100644 --- a/Library/Homebrew/test/cask/artifact/pkg_spec.rb +++ b/Library/Homebrew/test/cask/artifact/pkg_spec.rb @@ -12,12 +12,12 @@ describe Cask::Artifact::Pkg, :cask do expect(fake_system_command).to receive(:run!).with( "/usr/sbin/installer", - args: ["-pkg", cask.staged_path.join("MyFancyPkg", "Fancy.pkg"), "-target", "/"], - sudo: true, + args: ["-pkg", cask.staged_path.join("MyFancyPkg", "Fancy.pkg"), "-target", "/"], + sudo: true, print_stdout: true, - env: { - "LOGNAME" => ENV["USER"], - "USER" => ENV["USER"], + env: { + "LOGNAME" => ENV["USER"], + "USER" => ENV["USER"], "USERNAME" => ENV["USER"], }, ) @@ -57,16 +57,16 @@ describe Cask::Artifact::Pkg, :cask do expect(fake_system_command).to receive(:run!).with( "/usr/sbin/installer", - args: [ + args: [ "-pkg", cask.staged_path.join("MyFancyPkg", "Fancy.pkg"), "-target", "/", "-applyChoiceChangesXML", cask.staged_path.join("/tmp/choices.xml") ], - sudo: true, + sudo: true, print_stdout: true, - env: { - "LOGNAME" => ENV["USER"], - "USER" => ENV["USER"], + env: { + "LOGNAME" => ENV["USER"], + "USER" => ENV["USER"], "USERNAME" => ENV["USER"], }, ) diff --git a/Library/Homebrew/test/cask/artifact/uninstall_zap_shared_examples.rb b/Library/Homebrew/test/cask/artifact/uninstall_zap_shared_examples.rb index 650b275e13..5593679db3 100644 --- a/Library/Homebrew/test/cask/artifact/uninstall_zap_shared_examples.rb +++ b/Library/Homebrew/test/cask/artifact/uninstall_zap_shared_examples.rb @@ -236,10 +236,10 @@ shared_examples "#uninstall_phase or #zap_phase" do expect(fake_system_command).to receive(:run).with( cask.staged_path.join("MyFancyPkg", "FancyUninstaller.tool"), - args: ["--please"], + args: ["--please"], must_succeed: true, print_stdout: true, - sudo: false, + sudo: false, ) InstallHelper.install_without_artifacts(cask) diff --git a/Library/Homebrew/test/cmd/outdated_spec.rb b/Library/Homebrew/test/cmd/outdated_spec.rb index f24a3c5710..6a4a32d447 100644 --- a/Library/Homebrew/test/cmd/outdated_spec.rb +++ b/Library/Homebrew/test/cmd/outdated_spec.rb @@ -49,11 +49,11 @@ describe "brew outdated", :integration_test do expected_json = [ { - name: "testball", + name: "testball", installed_versions: ["0.0.1"], - current_version: "0.1", - pinned: true, - pinned_version: "0.0.1", + current_version: "0.1", + pinned: true, + pinned_version: "0.0.1", }, ].to_json @@ -69,11 +69,11 @@ describe "brew outdated", :integration_test do expected_json = [ { - name: "testball", + name: "testball", installed_versions: ["0.0.1"], - current_version: "0.1", - pinned: false, - pinned_version: nil, + current_version: "0.1", + pinned: false, + pinned_version: nil, }, ].to_json diff --git a/Library/Homebrew/test/cmd/search_spec.rb b/Library/Homebrew/test/cmd/search_spec.rb index f6abbf50bc..bdcbdbaf47 100644 --- a/Library/Homebrew/test/cmd/search_spec.rb +++ b/Library/Homebrew/test/cmd/search_spec.rb @@ -50,11 +50,11 @@ describe "brew search", :integration_test do { "macports" => "https://www.macports.org/ports.php?by=name&substr=testball", - "fink" => "http://pdb.finkproject.org/pdb/browse.php?summary=testball", - "debian" => "https://packages.debian.org/search?keywords=testball&searchon=names&suite=all§ion=all", + "fink" => "http://pdb.finkproject.org/pdb/browse.php?summary=testball", + "debian" => "https://packages.debian.org/search?keywords=testball&searchon=names&suite=all§ion=all", "opensuse" => "https://software.opensuse.org/search?q=testball", - "fedora" => "https://apps.fedoraproject.org/packages/s/testball", - "ubuntu" => "https://packages.ubuntu.com/search?keywords=testball&searchon=names&suite=all§ion=all", + "fedora" => "https://apps.fedoraproject.org/packages/s/testball", + "ubuntu" => "https://packages.ubuntu.com/search?keywords=testball&searchon=names&suite=all§ion=all", }.each do |flag, url| specify "--#{flag}" do expect { brew "search", "--#{flag}", "testball", "HOMEBREW_BROWSER" => "echo" } diff --git a/Library/Homebrew/test/compiler_selector_spec.rb b/Library/Homebrew/test/compiler_selector_spec.rb index 1a0be87545..b4ec54333a 100644 --- a/Library/Homebrew/test/compiler_selector_spec.rb +++ b/Library/Homebrew/test/compiler_selector_spec.rb @@ -11,8 +11,8 @@ describe CompilerSelector do double( gcc_4_0_build_version: Version::NULL, gcc_4_2_build_version: Version.create("5666"), - llvm_build_version: Version::NULL, - clang_build_version: Version.create("425"), + llvm_build_version: Version::NULL, + clang_build_version: Version.create("425"), ) end diff --git a/Library/Homebrew/test/download_strategies_spec.rb b/Library/Homebrew/test/download_strategies_spec.rb index c85cab0118..126ded85d5 100644 --- a/Library/Homebrew/test/download_strategies_spec.rb +++ b/Library/Homebrew/test/download_strategies_spec.rb @@ -99,11 +99,11 @@ describe "GitHubPrivateRepositoryReleaseDownloadStrategy", :needs_compat do release_metadata = { "assets" => [ { - "id" => 123, + "id" => 123, "name" => "foo_v0.1.0_linux_amd64.tar.gz", }, { - "id" => 456, + "id" => 456, "name" => "foo_v0.1.0_darwin_amd64.tar.gz", }, ], diff --git a/Library/Homebrew/test/rubocops/homepage_cop_spec.rb b/Library/Homebrew/test/rubocops/homepage_cop_spec.rb index 9240db0fd2..58d43c5748 100644 --- a/Library/Homebrew/test/rubocops/homepage_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/homepage_cop_spec.rb @@ -11,11 +11,11 @@ describe RuboCop::Cop::FormulaAudit::Homepage do end RUBY - expected_offenses = [{ message: "Formula should have a homepage.", + expected_offenses = [{ message: "Formula should have a homepage.", severity: :convention, - line: 1, - column: 0, - source: source }] + line: 1, + column: 0, + source: source }] inspect_source(source) @@ -32,11 +32,11 @@ describe RuboCop::Cop::FormulaAudit::Homepage do end RUBY - expected_offenses = [{ message: "The homepage should start with http or https (URL is ftp://example.com/foo).", + expected_offenses = [{ message: "The homepage should start with http or https (URL is ftp://example.com/foo).", severity: :convention, - line: 2, - column: 2, - source: source }] + line: 2, + column: 2, + source: source }] inspect_source(source) @@ -47,18 +47,18 @@ describe RuboCop::Cop::FormulaAudit::Homepage do it "Homepage URLs" do formula_homepages = { - "bar" => "http://www.freedesktop.org/wiki/bar", - "baz" => "http://www.freedesktop.org/wiki/Software/baz", - "qux" => "https://code.google.com/p/qux", - "quux" => "http://github.com/quux", - "corge" => "http://savannah.nongnu.org/corge", + "bar" => "http://www.freedesktop.org/wiki/bar", + "baz" => "http://www.freedesktop.org/wiki/Software/baz", + "qux" => "https://code.google.com/p/qux", + "quux" => "http://github.com/quux", + "corge" => "http://savannah.nongnu.org/corge", "grault" => "http://grault.github.io/", "garply" => "http://www.gnome.org/garply", - "sf1" => "http://foo.sourceforge.net/", - "sf2" => "http://foo.sourceforge.net", - "sf3" => "http://foo.sf.net/", - "sf4" => "http://foo.sourceforge.io/", - "waldo" => "http://www.gnu.org/waldo", + "sf1" => "http://foo.sourceforge.net/", + "sf2" => "http://foo.sourceforge.net", + "sf3" => "http://foo.sf.net/", + "sf4" => "http://foo.sourceforge.io/", + "waldo" => "http://www.gnu.org/waldo", } formula_homepages.each do |name, homepage| @@ -72,38 +72,38 @@ describe RuboCop::Cop::FormulaAudit::Homepage do inspect_source(source) if homepage =~ %r{http:\/\/www\.freedesktop\.org} if homepage =~ /Software/ - expected_offenses = [{ message: "#{homepage} should be styled " \ + expected_offenses = [{ message: "#{homepage} should be styled " \ "`https://wiki.freedesktop.org/www/Software/project_name`", severity: :convention, - line: 2, - column: 2, - source: source }] + line: 2, + column: 2, + source: source }] else expected_offenses = [{ message: "#{homepage} should be styled " \ "`https://wiki.freedesktop.org/project_name`", severity: :convention, - line: 2, - column: 2, - source: source }] + line: 2, + column: 2, + source: source }] end elsif homepage =~ %r{https:\/\/code\.google\.com} expected_offenses = [{ message: "#{homepage} should end with a slash", severity: :convention, - line: 2, - column: 2, - source: source }] + line: 2, + column: 2, + source: source }] elsif homepage =~ /foo\.(sf|sourceforge)\.net/ expected_offenses = [{ message: "#{homepage} should be `https://foo.sourceforge.io/`", severity: :convention, - line: 2, - column: 2, - source: source }] + line: 2, + column: 2, + source: source }] else expected_offenses = [{ message: "Please use https:// for #{homepage}", severity: :convention, - line: 2, - column: 2, - source: source }] + line: 2, + column: 2, + source: source }] end expected_offenses.zip([cop.offenses.last]).each do |expected, actual| expect_offense(expected, actual) diff --git a/Library/Homebrew/test/rubocops/patches_cop_spec.rb b/Library/Homebrew/test/rubocops/patches_cop_spec.rb index 7173092bac..271c9cd957 100644 --- a/Library/Homebrew/test/rubocops/patches_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/patches_cop_spec.rb @@ -48,66 +48,66 @@ describe RuboCop::Cop::FormulaAudit::Patches do inspect_source(source) expected_offense = if patch_url =~ %r{/raw\.github\.com/} [{ message: - <<~EOS.chomp, - GitHub/Gist patches should specify a revision: - #{patch_url} - EOS + <<~EOS.chomp, + GitHub/Gist patches should specify a revision: + #{patch_url} + EOS severity: :convention, - line: 5, - column: 12, - source: source }] + line: 5, + column: 12, + source: source }] elsif patch_url =~ %r{macports/trunk} [{ message: - <<~EOS.chomp, - MacPorts patches should specify a revision instead of trunk: - #{patch_url} - EOS + <<~EOS.chomp, + MacPorts patches should specify a revision instead of trunk: + #{patch_url} + EOS severity: :convention, - line: 5, - column: 33, - source: source }] + line: 5, + column: 33, + source: source }] elsif patch_url =~ %r{^http://trac\.macports\.org} [{ message: - <<~EOS.chomp, - Patches from MacPorts Trac should be https://, not http: - #{patch_url} - EOS + <<~EOS.chomp, + Patches from MacPorts Trac should be https://, not http: + #{patch_url} + EOS severity: :convention, - line: 5, - column: 5, - source: source }] + line: 5, + column: 5, + source: source }] elsif patch_url =~ %r{^http://bugs\.debian\.org} [{ message: - <<~EOS.chomp, - Patches from Debian should be https://, not http: - #{patch_url} - EOS + <<~EOS.chomp, + Patches from Debian should be https://, not http: + #{patch_url} + EOS severity: :convention, - line: 5, - column: 5, - source: source }] + line: 5, + column: 5, + source: source }] elsif patch_url =~ %r{https?://patch-diff\.githubusercontent\.com/raw/(.+)/(.+)/pull/(.+)\.(?:diff|patch)} [{ message: - <<~EOS, - use GitHub pull request URLs: - https://github.com/foo/foo-bar/pull/100.patch - Rather than patch-diff: - https://patch-diff.githubusercontent.com/raw/foo/foo-bar/pull/100.patch - EOS + <<~EOS, + use GitHub pull request URLs: + https://github.com/foo/foo-bar/pull/100.patch + Rather than patch-diff: + https://patch-diff.githubusercontent.com/raw/foo/foo-bar/pull/100.patch + EOS severity: :convention, - line: 5, - column: 5, - source: source }] + line: 5, + column: 5, + source: source }] elsif patch_url =~ %r{https?://github\.com/.+/.+/(?:commit|pull)/[a-fA-F0-9]*.(?:patch|diff)} [{ message: - <<~EOS, - GitHub patches should use the full_index parameter: - #{patch_url}?full_index=1 - EOS + <<~EOS, + GitHub patches should use the full_index parameter: + #{patch_url}?full_index=1 + EOS severity: :convention, - line: 5, - column: 5, - source: source }] + line: 5, + column: 5, + source: source }] end expected_offense.zip([cop.offenses.last]).each do |expected, actual| expect(actual.message).to eq(expected[:message]) @@ -133,20 +133,20 @@ describe RuboCop::Cop::FormulaAudit::Patches do end RUBY - expected_offenses = [{ message: "Use the patch DSL instead of defining a 'patches' method", + expected_offenses = [{ message: "Use the patch DSL instead of defining a 'patches' method", severity: :convention, - line: 4, - column: 2, - source: source }, + line: 4, + column: 2, + source: source }, { message: - <<~EOS.chomp, - Patches from MacPorts Trac should be https://, not http: - http://trac.macports.org/export/68507/trunk/dports/net/trafshow/files/ - EOS + <<~EOS.chomp, + Patches from MacPorts Trac should be https://, not http: + http://trac.macports.org/export/68507/trunk/dports/net/trafshow/files/ + EOS severity: :convention, - line: 8, - column: 26, - source: source }] + line: 8, + column: 26, + source: source }] inspect_source(source) @@ -183,56 +183,56 @@ describe RuboCop::Cop::FormulaAudit::Patches do inspect_source(source) expected_offense = if patch_url =~ %r{/raw\.github\.com/} [{ message: - <<~EOS.chomp, - GitHub/Gist patches should specify a revision: - #{patch_url} - EOS + <<~EOS.chomp, + GitHub/Gist patches should specify a revision: + #{patch_url} + EOS severity: :convention, - line: 5, - column: 16, - source: source }] + line: 5, + column: 16, + source: source }] elsif patch_url =~ %r{macports/trunk} [{ message: - <<~EOS.chomp, - MacPorts patches should specify a revision instead of trunk: - #{patch_url} - EOS + <<~EOS.chomp, + MacPorts patches should specify a revision instead of trunk: + #{patch_url} + EOS severity: :convention, - line: 5, - column: 37, - source: source }] + line: 5, + column: 37, + source: source }] elsif patch_url =~ %r{^http://trac\.macports\.org} [{ message: - <<~EOS.chomp, - Patches from MacPorts Trac should be https://, not http: - #{patch_url} - EOS + <<~EOS.chomp, + Patches from MacPorts Trac should be https://, not http: + #{patch_url} + EOS severity: :convention, - line: 5, - column: 9, - source: source }] + line: 5, + column: 9, + source: source }] elsif patch_url =~ %r{^http://bugs\.debian\.org} [{ message: - <<~EOS.chomp, - Patches from Debian should be https://, not http: - #{patch_url} - EOS + <<~EOS.chomp, + Patches from Debian should be https://, not http: + #{patch_url} + EOS severity: :convention, - line: 5, - column: 9, - source: source }] + line: 5, + column: 9, + source: source }] elsif patch_url =~ %r{https?://patch-diff\.githubusercontent\.com/raw/(.+)/(.+)/pull/(.+)\.(?:diff|patch)} [{ message: - <<~EOS, - use GitHub pull request URLs: - https://github.com/foo/foo-bar/pull/100.patch - Rather than patch-diff: - https://patch-diff.githubusercontent.com/raw/foo/foo-bar/pull/100.patch - EOS + <<~EOS, + use GitHub pull request URLs: + https://github.com/foo/foo-bar/pull/100.patch + Rather than patch-diff: + https://patch-diff.githubusercontent.com/raw/foo/foo-bar/pull/100.patch + EOS severity: :convention, - line: 5, - column: 9, - source: source }] + line: 5, + column: 9, + source: source }] end expected_offense.zip([cop.offenses.last]).each do |expected, actual| expect(actual.message).to eq(expected[:message]) diff --git a/Library/Homebrew/test/rubocops/urls_cop_spec.rb b/Library/Homebrew/test/rubocops/urls_cop_spec.rb index 34500a4d22..739e9be582 100644 --- a/Library/Homebrew/test/rubocops/urls_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/urls_cop_spec.rb @@ -149,11 +149,11 @@ describe RuboCop::Cop::FormulaAudit::Urls do url "#{formula["url"]}" end RUBY - expected_offenses = [{ message: formula["msg"], + expected_offenses = [{ message: formula["msg"], severity: :convention, - line: 3, - column: formula["col"], - source: source }] + line: 3, + column: formula["col"], + source: source }] inspect_source(source) diff --git a/Library/Homebrew/test/search_spec.rb b/Library/Homebrew/test/search_spec.rb index 1afcb1314a..ba44025dd7 100644 --- a/Library/Homebrew/test/search_spec.rb +++ b/Library/Homebrew/test/search_spec.rb @@ -28,13 +28,13 @@ describe Homebrew::Search do json_response = { "items" => [ { - "path" => "Formula/some-formula.rb", + "path" => "Formula/some-formula.rb", "repository" => { "full_name" => "Homebrew/homebrew-foo", }, }, { - "path" => "Casks/some-cask.rb", + "path" => "Casks/some-cask.rb", "repository" => { "full_name" => "Homebrew/homebrew-bar", }, diff --git a/Library/Homebrew/test/software_spec_spec.rb b/Library/Homebrew/test/software_spec_spec.rb index e6eaeb2048..a4e81f5db6 100644 --- a/Library/Homebrew/test/software_spec_spec.rb +++ b/Library/Homebrew/test/software_spec_spec.rb @@ -159,9 +159,9 @@ describe BottleSpecification do specify "#sha256" do checksums = { snow_leopard_32: "deadbeef" * 8, - snow_leopard: "faceb00c" * 8, - lion: "baadf00d" * 8, - mountain_lion: "8badf00d" * 8, + snow_leopard: "faceb00c" * 8, + lion: "baadf00d" * 8, + mountain_lion: "8badf00d" * 8, } checksums.each_pair do |cat, digest| diff --git a/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb b/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb index c09ae260b6..d787031d4e 100644 --- a/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb +++ b/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb @@ -72,13 +72,13 @@ RSpec.shared_context "integration test" do ].compact.join(File::PATH_SEPARATOR) env.merge!( - "PATH" => path, - "HOMEBREW_PATH" => path, - "HOMEBREW_BREW_FILE" => HOMEBREW_PREFIX/"bin/brew", + "PATH" => path, + "HOMEBREW_PATH" => path, + "HOMEBREW_BREW_FILE" => HOMEBREW_PREFIX/"bin/brew", "HOMEBREW_INTEGRATION_TEST" => command_id_from_args(args), - "HOMEBREW_TEST_TMPDIR" => TEST_TMPDIR, - "HOMEBREW_DEVELOPER" => ENV["HOMEBREW_DEVELOPER"], - "GEM_HOME" => nil, + "HOMEBREW_TEST_TMPDIR" => TEST_TMPDIR, + "HOMEBREW_DEVELOPER" => ENV["HOMEBREW_DEVELOPER"], + "GEM_HOME" => nil, ) @ruby_args ||= begin diff --git a/Library/Homebrew/test/system_command_spec.rb b/Library/Homebrew/test/system_command_spec.rb index afa0bd7e55..aeef194d4e 100644 --- a/Library/Homebrew/test/system_command_spec.rb +++ b/Library/Homebrew/test/system_command_spec.rb @@ -3,10 +3,10 @@ describe SystemCommand do subject(:command) { described_class.new( "env", - args: env_args, - env: env, + args: env_args, + env: env, must_succeed: true, - sudo: sudo, + sudo: sudo, ) } diff --git a/Library/Homebrew/test/tab_spec.rb b/Library/Homebrew/test/tab_spec.rb index 216a4532f2..91bd74222b 100644 --- a/Library/Homebrew/test/tab_spec.rb +++ b/Library/Homebrew/test/tab_spec.rb @@ -31,13 +31,13 @@ describe Tab do "stdlib" => "libcxx", "runtime_dependencies" => [], "source" => { - "tap" => CoreTap.instance.to_s, - "path" => CoreTap.instance.path.to_s, - "spec" => "stable", + "tap" => CoreTap.instance.to_s, + "path" => CoreTap.instance.path.to_s, + "spec" => "stable", "versions" => { "stable" => "0.10", - "devel" => "0.14", - "head" => "HEAD-1111111", + "devel" => "0.14", + "head" => "HEAD-1111111", }, }, ) diff --git a/Library/Homebrew/test/utils/github_spec.rb b/Library/Homebrew/test/utils/github_spec.rb index 320704e196..6e4b0cd4b9 100644 --- a/Library/Homebrew/test/utils/github_spec.rb +++ b/Library/Homebrew/test/utils/github_spec.rb @@ -32,9 +32,9 @@ describe GitHub do describe "::search_issues", :needs_network do it "queries GitHub issues with the passed parameters" do results = subject.search_issues("brew search", - repo: "Homebrew/legacy-homebrew", + repo: "Homebrew/legacy-homebrew", author: "MikeMcQuaid", - is: "closed") + is: "closed") expect(results).not_to be_empty expect(results.first["title"]).to eq("Shall we run `brew update` automatically?") end diff --git a/Library/Homebrew/test/utils_spec.rb b/Library/Homebrew/test/utils_spec.rb index 99965e8dec..7e6bb9dd2e 100644 --- a/Library/Homebrew/test/utils_spec.rb +++ b/Library/Homebrew/test/utils_spec.rb @@ -246,7 +246,7 @@ describe "globally-scoped helper methods" do expect { odeprecated( "method", "replacement", - caller: ["#{HOMEBREW_LIBRARY}/Taps/homebrew/homebrew-core/"], + caller: ["#{HOMEBREW_LIBRARY}/Taps/homebrew/homebrew-core/"], disable: true ) }.to raise_error( diff --git a/Library/Homebrew/unpack_strategy.rb b/Library/Homebrew/unpack_strategy.rb index 07390f9329..9ce91d8582 100644 --- a/Library/Homebrew/unpack_strategy.rb +++ b/Library/Homebrew/unpack_strategy.rb @@ -66,8 +66,8 @@ module UnpackStrategy def self.from_type(type) type = { - naked: :uncompressed, - nounzip: :uncompressed, + naked: :uncompressed, + nounzip: :uncompressed, seven_zip: :p7zip, }.fetch(type, type) diff --git a/Library/Homebrew/unpack_strategy/air.rb b/Library/Homebrew/unpack_strategy/air.rb index 393b9e8d11..480a5281de 100644 --- a/Library/Homebrew/unpack_strategy/air.rb +++ b/Library/Homebrew/unpack_strategy/air.rb @@ -28,7 +28,7 @@ module UnpackStrategy def extract_to_dir(unpack_dir, basename:, verbose:) system_command! AIR_APPLICATION_INSTALLER, - args: ["-silent", "-location", unpack_dir, path], + args: ["-silent", "-location", unpack_dir, path], verbose: verbose end end diff --git a/Library/Homebrew/unpack_strategy/bzip2.rb b/Library/Homebrew/unpack_strategy/bzip2.rb index 12ce68ad49..0a8e269259 100644 --- a/Library/Homebrew/unpack_strategy/bzip2.rb +++ b/Library/Homebrew/unpack_strategy/bzip2.rb @@ -18,7 +18,7 @@ module UnpackStrategy FileUtils.cp path, unpack_dir/basename, preserve: true quiet_flags = verbose ? [] : ["-q"] system_command! "bunzip2", - args: [*quiet_flags, unpack_dir/basename], + args: [*quiet_flags, unpack_dir/basename], verbose: verbose end end diff --git a/Library/Homebrew/unpack_strategy/cab.rb b/Library/Homebrew/unpack_strategy/cab.rb index dcbe0e6113..f2510d087f 100644 --- a/Library/Homebrew/unpack_strategy/cab.rb +++ b/Library/Homebrew/unpack_strategy/cab.rb @@ -14,8 +14,8 @@ module UnpackStrategy def extract_to_dir(unpack_dir, basename:, verbose:) system_command! "cabextract", - args: ["-d", unpack_dir, "--", path], - env: { "PATH" => PATH.new(Formula["cabextract"].opt_bin, ENV["PATH"]) }, + args: ["-d", unpack_dir, "--", path], + env: { "PATH" => PATH.new(Formula["cabextract"].opt_bin, ENV["PATH"]) }, verbose: verbose end diff --git a/Library/Homebrew/unpack_strategy/directory.rb b/Library/Homebrew/unpack_strategy/directory.rb index e3bcdc122d..cbfc75b54c 100644 --- a/Library/Homebrew/unpack_strategy/directory.rb +++ b/Library/Homebrew/unpack_strategy/directory.rb @@ -17,7 +17,7 @@ module UnpackStrategy def extract_to_dir(unpack_dir, basename:, verbose:) path.children.each do |child| system_command! "cp", - args: ["-pR", child.directory? ? "#{child}/." : child, unpack_dir/child.basename], + args: ["-pR", child.directory? ? "#{child}/." : child, unpack_dir/child.basename], verbose: verbose end end diff --git a/Library/Homebrew/unpack_strategy/dmg.rb b/Library/Homebrew/unpack_strategy/dmg.rb index e6cd6b9730..9768981cb4 100644 --- a/Library/Homebrew/unpack_strategy/dmg.rb +++ b/Library/Homebrew/unpack_strategy/dmg.rb @@ -58,14 +58,14 @@ module UnpackStrategy if tries > 1 system_command! "diskutil", - args: ["eject", path], + args: ["eject", path], print_stderr: false, - verbose: verbose + verbose: verbose else system_command! "diskutil", - args: ["unmount", "force", path], + args: ["unmount", "force", path], print_stderr: false, - verbose: verbose + verbose: verbose end rescue ErrorDuringExecution => e raise e if (tries -= 1).zero? @@ -85,12 +85,12 @@ module UnpackStrategy filelist.close system_command! "mkbom", - args: ["-s", "-i", filelist.path, "--", bomfile.path], + args: ["-s", "-i", filelist.path, "--", bomfile.path], verbose: verbose end system_command! "ditto", - args: ["--bom", bomfile.path, "--", path, unpack_dir], + args: ["--bom", bomfile.path, "--", path, unpack_dir], verbose: verbose FileUtils.chmod "u+w", Pathname.glob(unpack_dir/"**/*", File::FNM_DOTMATCH).reject(&:symlink?) @@ -105,7 +105,7 @@ module UnpackStrategy def self.can_extract?(path) imageinfo = system_command("hdiutil", - args: ["imageinfo", path], + args: ["imageinfo", path], print_stderr: false).stdout !imageinfo.empty? @@ -129,13 +129,13 @@ module UnpackStrategy without_eula = system_command( "hdiutil", - args: [ + args: [ "attach", "-plist", "-nobrowse", "-readonly", "-noidme", "-mountrandom", mount_dir, path ], - input: "qn\n", + input: "qn\n", print_stderr: false, - verbose: verbose, + verbose: verbose, ) # If mounting without agreeing to EULA succeeded, there is none. @@ -148,7 +148,7 @@ module UnpackStrategy system_command!( "hdiutil", - args: [ + args: [ "convert", *quiet_flag, "-format", "UDTO", "-o", cdr_path, path ], verbose: verbose, @@ -156,7 +156,7 @@ module UnpackStrategy with_eula = system_command!( "hdiutil", - args: [ + args: [ "attach", "-plist", "-nobrowse", "-readonly", "-noidme", "-mountrandom", mount_dir, cdr_path ], diff --git a/Library/Homebrew/unpack_strategy/fossil.rb b/Library/Homebrew/unpack_strategy/fossil.rb index 846219e137..3bcfbd4725 100644 --- a/Library/Homebrew/unpack_strategy/fossil.rb +++ b/Library/Homebrew/unpack_strategy/fossil.rb @@ -26,9 +26,9 @@ module UnpackStrategy end system_command! "fossil", - args: ["open", path, *args], - chdir: unpack_dir, - env: { "PATH" => PATH.new(Formula["fossil"].opt_bin, ENV["PATH"]) }, + args: ["open", path, *args], + chdir: unpack_dir, + env: { "PATH" => PATH.new(Formula["fossil"].opt_bin, ENV["PATH"]) }, verbose: verbose end end diff --git a/Library/Homebrew/unpack_strategy/generic_unar.rb b/Library/Homebrew/unpack_strategy/generic_unar.rb index 9833635cbb..a0c9fe40de 100644 --- a/Library/Homebrew/unpack_strategy/generic_unar.rb +++ b/Library/Homebrew/unpack_strategy/generic_unar.rb @@ -20,11 +20,11 @@ module UnpackStrategy def extract_to_dir(unpack_dir, basename:, verbose:) system_command! "unar", - args: [ + args: [ "-force-overwrite", "-quiet", "-no-directory", "-output-directory", unpack_dir, "--", path ], - env: { "PATH" => PATH.new(Formula["unar"].opt_bin, ENV["PATH"]) }, + env: { "PATH" => PATH.new(Formula["unar"].opt_bin, ENV["PATH"]) }, verbose: verbose end end diff --git a/Library/Homebrew/unpack_strategy/gzip.rb b/Library/Homebrew/unpack_strategy/gzip.rb index 2ea64b9ba9..930fed4ed0 100644 --- a/Library/Homebrew/unpack_strategy/gzip.rb +++ b/Library/Homebrew/unpack_strategy/gzip.rb @@ -18,7 +18,7 @@ module UnpackStrategy FileUtils.cp path, unpack_dir/basename, preserve: true quiet_flags = verbose ? [] : ["-q"] system_command! "gunzip", - args: [*quiet_flags, "-N", "--", unpack_dir/basename], + args: [*quiet_flags, "-N", "--", unpack_dir/basename], verbose: verbose end end diff --git a/Library/Homebrew/unpack_strategy/lha.rb b/Library/Homebrew/unpack_strategy/lha.rb index 1e69bad8ea..2d92e65544 100644 --- a/Library/Homebrew/unpack_strategy/lha.rb +++ b/Library/Homebrew/unpack_strategy/lha.rb @@ -20,8 +20,8 @@ module UnpackStrategy def extract_to_dir(unpack_dir, basename:, verbose:) system_command! "lha", - args: ["xq2w=#{unpack_dir}", path], - env: { "PATH" => PATH.new(Formula["lha"].opt_bin, ENV["PATH"]) }, + args: ["xq2w=#{unpack_dir}", path], + env: { "PATH" => PATH.new(Formula["lha"].opt_bin, ENV["PATH"]) }, verbose: verbose end end diff --git a/Library/Homebrew/unpack_strategy/lzip.rb b/Library/Homebrew/unpack_strategy/lzip.rb index c18079f77f..2a6792be16 100644 --- a/Library/Homebrew/unpack_strategy/lzip.rb +++ b/Library/Homebrew/unpack_strategy/lzip.rb @@ -22,8 +22,8 @@ module UnpackStrategy FileUtils.cp path, unpack_dir/basename, preserve: true quiet_flags = verbose ? [] : ["-q"] system_command! "lzip", - args: ["-d", *quiet_flags, unpack_dir/basename], - env: { "PATH" => PATH.new(Formula["lzip"].opt_bin, ENV["PATH"]) }, + args: ["-d", *quiet_flags, unpack_dir/basename], + env: { "PATH" => PATH.new(Formula["lzip"].opt_bin, ENV["PATH"]) }, verbose: verbose end end diff --git a/Library/Homebrew/unpack_strategy/lzma.rb b/Library/Homebrew/unpack_strategy/lzma.rb index 961731c6bd..a611db87d9 100644 --- a/Library/Homebrew/unpack_strategy/lzma.rb +++ b/Library/Homebrew/unpack_strategy/lzma.rb @@ -16,8 +16,8 @@ module UnpackStrategy FileUtils.cp path, unpack_dir/basename, preserve: true quiet_flags = verbose ? [] : ["-q"] system_command! "unlzma", - args: [*quiet_flags, "--", unpack_dir/basename], - env: { "PATH" => PATH.new(Formula["xz"].opt_bin, ENV["PATH"]) }, + args: [*quiet_flags, "--", unpack_dir/basename], + env: { "PATH" => PATH.new(Formula["xz"].opt_bin, ENV["PATH"]) }, verbose: verbose end diff --git a/Library/Homebrew/unpack_strategy/mercurial.rb b/Library/Homebrew/unpack_strategy/mercurial.rb index 15ca078930..18088954d8 100644 --- a/Library/Homebrew/unpack_strategy/mercurial.rb +++ b/Library/Homebrew/unpack_strategy/mercurial.rb @@ -12,8 +12,8 @@ module UnpackStrategy def extract_to_dir(unpack_dir, basename:, verbose:) system_command! "hg", - args: ["--cwd", path, "archive", "--subrepos", "-y", "-t", "files", unpack_dir], - env: { "PATH" => PATH.new(Formula["mercurial"].opt_bin, ENV["PATH"]) }, + args: ["--cwd", path, "archive", "--subrepos", "-y", "-t", "files", unpack_dir], + env: { "PATH" => PATH.new(Formula["mercurial"].opt_bin, ENV["PATH"]) }, verbose: verbose end end diff --git a/Library/Homebrew/unpack_strategy/p7zip.rb b/Library/Homebrew/unpack_strategy/p7zip.rb index d5fd3a181f..9241d9dc3e 100644 --- a/Library/Homebrew/unpack_strategy/p7zip.rb +++ b/Library/Homebrew/unpack_strategy/p7zip.rb @@ -20,8 +20,8 @@ module UnpackStrategy def extract_to_dir(unpack_dir, basename:, verbose:) system_command! "7zr", - args: ["x", "-y", "-bd", "-bso0", path, "-o#{unpack_dir}"], - env: { "PATH" => PATH.new(Formula["p7zip"].opt_bin, ENV["PATH"]) }, + args: ["x", "-y", "-bd", "-bso0", path, "-o#{unpack_dir}"], + env: { "PATH" => PATH.new(Formula["p7zip"].opt_bin, ENV["PATH"]) }, verbose: verbose end end diff --git a/Library/Homebrew/unpack_strategy/pax.rb b/Library/Homebrew/unpack_strategy/pax.rb index 9ad4354c53..c4194879f2 100644 --- a/Library/Homebrew/unpack_strategy/pax.rb +++ b/Library/Homebrew/unpack_strategy/pax.rb @@ -16,8 +16,8 @@ module UnpackStrategy def extract_to_dir(unpack_dir, basename:, verbose:) system_command! "pax", - args: ["-rf", path], - chdir: unpack_dir, + args: ["-rf", path], + chdir: unpack_dir, verbose: verbose end end diff --git a/Library/Homebrew/unpack_strategy/rar.rb b/Library/Homebrew/unpack_strategy/rar.rb index c8fa5df29e..890c04460f 100644 --- a/Library/Homebrew/unpack_strategy/rar.rb +++ b/Library/Homebrew/unpack_strategy/rar.rb @@ -20,8 +20,8 @@ module UnpackStrategy def extract_to_dir(unpack_dir, basename:, verbose:) system_command! "unrar", - args: ["x", "-inul", path, unpack_dir], - env: { "PATH" => PATH.new(Formula["unrar"].opt_bin, ENV["PATH"]) }, + args: ["x", "-inul", path, unpack_dir], + env: { "PATH" => PATH.new(Formula["unrar"].opt_bin, ENV["PATH"]) }, verbose: verbose end end diff --git a/Library/Homebrew/unpack_strategy/subversion.rb b/Library/Homebrew/unpack_strategy/subversion.rb index 4c215e2672..0a2f922ba9 100644 --- a/Library/Homebrew/unpack_strategy/subversion.rb +++ b/Library/Homebrew/unpack_strategy/subversion.rb @@ -12,8 +12,8 @@ module UnpackStrategy def extract_to_dir(unpack_dir, basename:, verbose:) system_command! "svn", - args: ["export", "--force", ".", unpack_dir], - chdir: path.to_s, + args: ["export", "--force", ".", unpack_dir], + chdir: path.to_s, verbose: verbose end end diff --git a/Library/Homebrew/unpack_strategy/tar.rb b/Library/Homebrew/unpack_strategy/tar.rb index 1d273fb4e8..390acfba77 100644 --- a/Library/Homebrew/unpack_strategy/tar.rb +++ b/Library/Homebrew/unpack_strategy/tar.rb @@ -40,7 +40,7 @@ module UnpackStrategy end system_command! "tar", - args: ["xf", tar_path, "-C", unpack_dir], + args: ["xf", tar_path, "-C", unpack_dir], verbose: verbose end end diff --git a/Library/Homebrew/unpack_strategy/xar.rb b/Library/Homebrew/unpack_strategy/xar.rb index 0ebb198bfe..ada4386d38 100644 --- a/Library/Homebrew/unpack_strategy/xar.rb +++ b/Library/Homebrew/unpack_strategy/xar.rb @@ -16,7 +16,7 @@ module UnpackStrategy def extract_to_dir(unpack_dir, basename:, verbose:) system_command! "xar", - args: ["-x", "-f", path, "-C", unpack_dir], + args: ["-x", "-f", path, "-C", unpack_dir], verbose: verbose end end diff --git a/Library/Homebrew/unpack_strategy/xz.rb b/Library/Homebrew/unpack_strategy/xz.rb index 0f980a4887..0ce1a899c3 100644 --- a/Library/Homebrew/unpack_strategy/xz.rb +++ b/Library/Homebrew/unpack_strategy/xz.rb @@ -22,8 +22,8 @@ module UnpackStrategy FileUtils.cp path, unpack_dir/basename, preserve: true quiet_flags = verbose ? [] : ["-q"] system_command! "unxz", - args: [*quiet_flags, "-T0", "--", unpack_dir/basename], - env: { "PATH" => PATH.new(Formula["xz"].opt_bin, ENV["PATH"]) }, + args: [*quiet_flags, "-T0", "--", unpack_dir/basename], + env: { "PATH" => PATH.new(Formula["xz"].opt_bin, ENV["PATH"]) }, verbose: verbose end end diff --git a/Library/Homebrew/unpack_strategy/zip.rb b/Library/Homebrew/unpack_strategy/zip.rb index 44671ba9b7..2c19f01125 100644 --- a/Library/Homebrew/unpack_strategy/zip.rb +++ b/Library/Homebrew/unpack_strategy/zip.rb @@ -17,8 +17,8 @@ module UnpackStrategy def extract_to_dir(unpack_dir, basename:, verbose:) quiet_flags = verbose ? [] : ["-qq"] result = system_command! "unzip", - args: [*quiet_flags, path, "-d", unpack_dir], - verbose: verbose, + args: [*quiet_flags, path, "-d", unpack_dir], + verbose: verbose, print_stderr: false FileUtils.rm_rf unpack_dir/"__MACOSX" diff --git a/Library/Homebrew/utils/curl.rb b/Library/Homebrew/utils/curl.rb index 6917cc1923..707faac690 100644 --- a/Library/Homebrew/utils/curl.rb +++ b/Library/Homebrew/utils/curl.rb @@ -42,9 +42,9 @@ def curl(*args) # SSL_CERT_FILE can be incorrectly set by users or portable-ruby and screw # with SSL downloads so unset it here. system_command! curl_executable, - args: curl_args(*args), + args: curl_args(*args), print_stdout: true, - env: { "SSL_CERT_FILE" => nil } + env: { "SSL_CERT_FILE" => nil } end def curl_download(*args, to: nil, **options) @@ -65,7 +65,7 @@ end def curl_output(*args, **options) system_command(curl_executable, - args: curl_args(*args, show_output: true, **options), + args: curl_args(*args, show_output: true, **options), print_stderr: false) end @@ -155,10 +155,10 @@ def curl_http_content_headers_and_checksum(url, hash_needed: false, user_agent: output_hash = Digest::SHA256.digest(output) if hash_needed { - status: status_code, - etag: headers[%r{ETag: ([wW]\/)?"(([^"]|\\")*)"}, 2], + status: status_code, + etag: headers[%r{ETag: ([wW]\/)?"(([^"]|\\")*)"}, 2], content_length: headers[/Content-Length: (\d+)/, 1], - file_hash: output_hash, - file: output, + file_hash: output_hash, + file: output, } end diff --git a/Library/Homebrew/utils/shell.rb b/Library/Homebrew/utils/shell.rb index d53741603e..4444f24d4c 100644 --- a/Library/Homebrew/utils/shell.rb +++ b/Library/Homebrew/utils/shell.rb @@ -64,15 +64,15 @@ module Utils SHELL_PROFILE_MAP = { bash: "~/.bash_profile", - csh: "~/.cshrc", + csh: "~/.cshrc", fish: "~/.config/fish/config.fish", - ksh: "~/.kshrc", - sh: "~/.bash_profile", + ksh: "~/.kshrc", + sh: "~/.bash_profile", tcsh: "~/.tcshrc", - zsh: "~/.zshrc", + zsh: "~/.zshrc", }.freeze - UNSAFE_SHELL_CHAR = %r{([^A-Za-z0-9_\-.,:/@~\n])} + UNSAFE_SHELL_CHAR = %r{([^A-Za-z0-9_\-.,:/@~\n])}.freeze def csh_quote(str) # ruby's implementation of shell_escape diff --git a/Library/Homebrew/utils/tty.rb b/Library/Homebrew/utils/tty.rb index 8a98cf1a29..6f3836280c 100644 --- a/Library/Homebrew/utils/tty.rb +++ b/Library/Homebrew/utils/tty.rb @@ -19,22 +19,22 @@ module Tty end COLOR_CODES = { - red: 31, - green: 32, - yellow: 33, - blue: 34, + red: 31, + green: 32, + yellow: 33, + blue: 34, magenta: 35, - cyan: 36, + cyan: 36, default: 39, }.freeze STYLE_CODES = { - reset: 0, - bold: 1, - italic: 3, - underline: 4, + reset: 0, + bold: 1, + italic: 3, + underline: 4, strikethrough: 9, - no_underline: 24, + no_underline: 24, }.freeze CODES = COLOR_CODES.merge(STYLE_CODES).freeze diff --git a/Library/Homebrew/version.rb b/Library/Homebrew/version.rb index b06624a8b6..c3ed4fb544 100644 --- a/Library/Homebrew/version.rb +++ b/Library/Homebrew/version.rb @@ -55,7 +55,7 @@ class Version NULL_TOKEN = NullToken.new class StringToken < Token - PATTERN = /[a-z]+[0-9]*/i + PATTERN = /[a-z]+[0-9]*/i.freeze def initialize(value) @value = value.to_s @@ -72,7 +72,7 @@ class Version end class NumericToken < Token - PATTERN = /[0-9]+/i + PATTERN = /[0-9]+/i.freeze def initialize(value) @value = value.to_i @@ -101,7 +101,7 @@ class Version end class AlphaToken < CompositeToken - PATTERN = /alpha[0-9]*|a[0-9]+/i + PATTERN = /alpha[0-9]*|a[0-9]+/i.freeze def <=>(other) case other @@ -116,7 +116,7 @@ class Version end class BetaToken < CompositeToken - PATTERN = /beta[0-9]*|b[0-9]+/i + PATTERN = /beta[0-9]*|b[0-9]+/i.freeze def <=>(other) case other @@ -133,7 +133,7 @@ class Version end class PreToken < CompositeToken - PATTERN = /pre[0-9]*/i + PATTERN = /pre[0-9]*/i.freeze def <=>(other) case other @@ -150,7 +150,7 @@ class Version end class RCToken < CompositeToken - PATTERN = /rc[0-9]*/i + PATTERN = /rc[0-9]*/i.freeze def <=>(other) case other @@ -167,7 +167,7 @@ class Version end class PatchToken < CompositeToken - PATTERN = /p[0-9]*/i + PATTERN = /p[0-9]*/i.freeze def <=>(other) case other From 549b02f20acffe88cdb3ea2010ee34a0569bbfe6 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 2 Nov 2018 17:27:24 +0000 Subject: [PATCH 5/5] Manual `brew style` fixes. --- Library/Homebrew/formula.rb | 25 +++++++++++++------ Library/Homebrew/global.rb | 6 +++-- .../test/rubocops/homepage_cop_spec.rb | 11 ++++---- 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index a3d1d41c83..2d0be7bd66 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -327,7 +327,7 @@ class Formula active_spec == head end - delegate [ + delegate [ # rubocop:disable Layout/AlignHash :bottle_unneeded?, :bottle_disabled?, :bottle_disable_reason, @@ -335,7 +335,7 @@ class Formula :bottled?, :bottle_specification, :downloader, - ] => :active_spec + ] => :active_spec # The Bottle object for the currently active {SoftwareSpec}. # @private @@ -1615,10 +1615,20 @@ class Formula "bottle" => {}, "keg_only" => keg_only?, "options" => [], - "build_dependencies" => dependencies.select(&:build?).map(&:name).uniq, - "dependencies" => dependencies.reject(&:optional?).reject(&:recommended?).reject(&:build?).map(&:name).uniq, - "recommended_dependencies" => dependencies.select(&:recommended?).map(&:name).uniq, - "optional_dependencies" => dependencies.select(&:optional?).map(&:name).uniq, + "build_dependencies" => dependencies.select(&:build?) + .map(&:name) + .uniq, + "dependencies" => dependencies.reject(&:optional?) + .reject(&:recommended?) + .reject(&:build?) + .map(&:name) + .uniq, + "recommended_dependencies" => dependencies.select(&:recommended?) + .map(&:name) + .uniq, + "optional_dependencies" => dependencies.select(&:optional?) + .map(&:name) + .uniq, "requirements" => [], "conflicts_with" => conflicts.map(&:name), "caveats" => caveats, @@ -1641,9 +1651,10 @@ class Formula } bottle_info["files"] = {} bottle_spec.collector.keys.each do |os| + bottle_url = "#{bottle_spec.root_url}/#{Bottle::Filename.create(self, os, bottle_spec.rebuild).bintray}" checksum = bottle_spec.collector[os] bottle_info["files"][os] = { - "url" => "#{bottle_spec.root_url}/#{Bottle::Filename.create(self, os, bottle_spec.rebuild).bintray}", + "url" => bottle_url, checksum.hash_type.to_s => checksum.hexdigest, } end diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb index e2d51f2194..041ec86b94 100644 --- a/Library/Homebrew/global.rb +++ b/Library/Homebrew/global.rb @@ -104,8 +104,10 @@ module Homebrew end end -HOMEBREW_PULL_API_REGEX = %r{https://api\.github\.com/repos/([\w-]+)/([\w-]+)?/pulls/(\d+)}.freeze -HOMEBREW_PULL_OR_COMMIT_URL_REGEX = %r[https://github\.com/([\w-]+)/([\w-]+)?/(?:pull/(\d+)|commit/[0-9a-fA-F]{4,40})].freeze +HOMEBREW_PULL_API_REGEX = + %r{https://api\.github\.com/repos/([\w-]+)/([\w-]+)?/pulls/(\d+)}.freeze +HOMEBREW_PULL_OR_COMMIT_URL_REGEX = + %r[https://github\.com/([\w-]+)/([\w-]+)?/(?:pull/(\d+)|commit/[0-9a-fA-F]{4,40})].freeze require "forwardable" require "PATH" diff --git a/Library/Homebrew/test/rubocops/homepage_cop_spec.rb b/Library/Homebrew/test/rubocops/homepage_cop_spec.rb index 58d43c5748..3758b28a19 100644 --- a/Library/Homebrew/test/rubocops/homepage_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/homepage_cop_spec.rb @@ -32,11 +32,12 @@ describe RuboCop::Cop::FormulaAudit::Homepage do end RUBY - expected_offenses = [{ message: "The homepage should start with http or https (URL is ftp://example.com/foo).", - severity: :convention, - line: 2, - column: 2, - source: source }] + expected_offenses = [{ message: "The homepage should start with http or " \ + "https (URL is ftp://example.com/foo).", + severity: :convention, + line: 2, + column: 2, + source: source }] inspect_source(source)