rubocop-rspec 1.33.0 → 1.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -2
  3. data/README.md +10 -2
  4. data/config/default.yml +6 -1
  5. data/lib/rubocop/cop/rspec/any_instance.rb +0 -1
  6. data/lib/rubocop/cop/rspec/around_block.rb +1 -2
  7. data/lib/rubocop/cop/rspec/before_after_all.rb +0 -1
  8. data/lib/rubocop/cop/rspec/context_wording.rb +18 -17
  9. data/lib/rubocop/cop/rspec/describe_class.rb +1 -1
  10. data/lib/rubocop/cop/rspec/describe_method.rb +1 -1
  11. data/lib/rubocop/cop/rspec/describe_symbol.rb +1 -1
  12. data/lib/rubocop/cop/rspec/described_class.rb +79 -13
  13. data/lib/rubocop/cop/rspec/empty_example_group.rb +1 -1
  14. data/lib/rubocop/cop/rspec/empty_line_after_subject.rb +1 -1
  15. data/lib/rubocop/cop/rspec/example_length.rb +1 -1
  16. data/lib/rubocop/cop/rspec/example_wording.rb +6 -4
  17. data/lib/rubocop/cop/rspec/expect_actual.rb +1 -1
  18. data/lib/rubocop/cop/rspec/expect_output.rb +2 -0
  19. data/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb +1 -1
  20. data/lib/rubocop/cop/rspec/factory_bot/create_list.rb +1 -2
  21. data/lib/rubocop/cop/rspec/file_path.rb +0 -1
  22. data/lib/rubocop/cop/rspec/focus.rb +1 -1
  23. data/lib/rubocop/cop/rspec/hook_argument.rb +0 -1
  24. data/lib/rubocop/cop/rspec/instance_spy.rb +1 -1
  25. data/lib/rubocop/cop/rspec/instance_variable.rb +1 -1
  26. data/lib/rubocop/cop/rspec/invalid_predicate_matcher.rb +1 -1
  27. data/lib/rubocop/cop/rspec/it_behaves_like.rb +1 -1
  28. data/lib/rubocop/cop/rspec/iterated_expectation.rb +1 -1
  29. data/lib/rubocop/cop/rspec/leading_subject.rb +0 -1
  30. data/lib/rubocop/cop/rspec/leaky_constant_declaration.rb +128 -0
  31. data/lib/rubocop/cop/rspec/let_before_examples.rb +1 -1
  32. data/lib/rubocop/cop/rspec/let_setup.rb +2 -4
  33. data/lib/rubocop/cop/rspec/missing_example_group_argument.rb +1 -2
  34. data/lib/rubocop/cop/rspec/multiple_describes.rb +1 -1
  35. data/lib/rubocop/cop/rspec/multiple_expectations.rb +32 -16
  36. data/lib/rubocop/cop/rspec/multiple_subjects.rb +1 -1
  37. data/lib/rubocop/cop/rspec/nested_groups.rb +0 -1
  38. data/lib/rubocop/cop/rspec/overwriting_setup.rb +0 -1
  39. data/lib/rubocop/cop/rspec/pending.rb +1 -1
  40. data/lib/rubocop/cop/rspec/predicate_matcher.rb +0 -3
  41. data/lib/rubocop/cop/rspec/repeated_description.rb +1 -1
  42. data/lib/rubocop/cop/rspec/repeated_example.rb +1 -1
  43. data/lib/rubocop/cop/rspec/scattered_let.rb +1 -1
  44. data/lib/rubocop/cop/rspec/scattered_setup.rb +1 -1
  45. data/lib/rubocop/cop/rspec/shared_context.rb +0 -1
  46. data/lib/rubocop/cop/rspec/single_argument_message_chain.rb +1 -1
  47. data/lib/rubocop/cop/rspec/subject_stub.rb +17 -20
  48. data/lib/rubocop/cop/rspec/unspecified_exception.rb +1 -4
  49. data/lib/rubocop/cop/rspec/verified_doubles.rb +1 -1
  50. data/lib/rubocop/cop/rspec/void_expect.rb +1 -1
  51. data/lib/rubocop/cop/rspec_cops.rb +1 -0
  52. data/lib/rubocop/rspec/language.rb +1 -1
  53. data/lib/rubocop/rspec/top_level_describe.rb +0 -4
  54. data/lib/rubocop/rspec/version.rb +1 -1
  55. data/spec/rubocop/cop/rspec/cop_spec.rb +3 -3
  56. data/spec/rubocop/cop/rspec/describe_class_spec.rb +7 -0
  57. data/spec/rubocop/cop/rspec/described_class_spec.rb +113 -80
  58. data/spec/rubocop/cop/rspec/example_wording_spec.rb +33 -0
  59. data/spec/rubocop/cop/rspec/leaky_constant_declaration_spec.rb +91 -0
  60. data/spec/rubocop/cop/rspec/let_setup_spec.rb +2 -2
  61. data/spec/rubocop/cop/rspec/multiple_expectations_spec.rb +64 -37
  62. data/spec/rubocop/cop/rspec/subject_stub_spec.rb +113 -14
  63. data/spec/rubocop/rspec/language/selector_set_spec.rb +2 -2
  64. metadata +5 -2
@@ -38,7 +38,7 @@ RSpec.describe RuboCop::RSpec::Language::SelectorSet do
38
38
  describe '#send_pattern' do
39
39
  it 'builds a send matching pattern' do
40
40
  expect(selector_set.send_pattern).to eql(
41
- '(send {(const nil? :RSpec) nil?} {:foo :bar} ...)'
41
+ '(send {(const {nil? cbase} :RSpec) nil?} {:foo :bar} ...)'
42
42
  )
43
43
  end
44
44
  end
@@ -46,7 +46,7 @@ RSpec.describe RuboCop::RSpec::Language::SelectorSet do
46
46
  describe '#block_pattern' do
47
47
  it 'builds a block matching pattern' do
48
48
  expect(selector_set.block_pattern).to eql(
49
- '(block (send {(const nil? :RSpec) nil?} {:foo :bar} ...) ...)'
49
+ '(block (send {(const {nil? cbase} :RSpec) nil?} {:foo :bar} ...) ...)'
50
50
  )
51
51
  end
52
52
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.33.0
4
+ version: 1.34.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Backus
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-05-13 00:00:00.000000000 Z
13
+ date: 2019-07-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rubocop
@@ -158,6 +158,7 @@ files:
158
158
  - lib/rubocop/cop/rspec/it_behaves_like.rb
159
159
  - lib/rubocop/cop/rspec/iterated_expectation.rb
160
160
  - lib/rubocop/cop/rspec/leading_subject.rb
161
+ - lib/rubocop/cop/rspec/leaky_constant_declaration.rb
161
162
  - lib/rubocop/cop/rspec/let_before_examples.rb
162
163
  - lib/rubocop/cop/rspec/let_setup.rb
163
164
  - lib/rubocop/cop/rspec/message_chain.rb
@@ -255,6 +256,7 @@ files:
255
256
  - spec/rubocop/cop/rspec/it_behaves_like_spec.rb
256
257
  - spec/rubocop/cop/rspec/iterated_expectation_spec.rb
257
258
  - spec/rubocop/cop/rspec/leading_subject_spec.rb
259
+ - spec/rubocop/cop/rspec/leaky_constant_declaration_spec.rb
258
260
  - spec/rubocop/cop/rspec/let_before_examples_spec.rb
259
261
  - spec/rubocop/cop/rspec/let_setup_spec.rb
260
262
  - spec/rubocop/cop/rspec/message_chain_spec.rb
@@ -374,6 +376,7 @@ test_files:
374
376
  - spec/rubocop/cop/rspec/it_behaves_like_spec.rb
375
377
  - spec/rubocop/cop/rspec/iterated_expectation_spec.rb
376
378
  - spec/rubocop/cop/rspec/leading_subject_spec.rb
379
+ - spec/rubocop/cop/rspec/leaky_constant_declaration_spec.rb
377
380
  - spec/rubocop/cop/rspec/let_before_examples_spec.rb
378
381
  - spec/rubocop/cop/rspec/let_setup_spec.rb
379
382
  - spec/rubocop/cop/rspec/message_chain_spec.rb