rubocop-rspec 1.42.0 → 1.43.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/config/default.yml +12 -2
  4. data/lib/rubocop-rspec.rb +2 -1
  5. data/lib/rubocop/cop/rspec/align_left_let_brace.rb +1 -1
  6. data/lib/rubocop/cop/rspec/align_right_let_brace.rb +1 -1
  7. data/lib/rubocop/cop/rspec/any_instance.rb +1 -1
  8. data/lib/rubocop/cop/rspec/around_block.rb +1 -1
  9. data/lib/rubocop/cop/rspec/base.rb +74 -0
  10. data/lib/rubocop/cop/rspec/be.rb +1 -1
  11. data/lib/rubocop/cop/rspec/be_eql.rb +1 -1
  12. data/lib/rubocop/cop/rspec/before_after_all.rb +1 -1
  13. data/lib/rubocop/cop/rspec/capybara/current_path_expectation.rb +1 -1
  14. data/lib/rubocop/cop/rspec/capybara/feature_methods.rb +6 -3
  15. data/lib/rubocop/cop/rspec/capybara/visibility_matcher.rb +1 -1
  16. data/lib/rubocop/cop/rspec/context_method.rb +2 -2
  17. data/lib/rubocop/cop/rspec/context_wording.rb +3 -3
  18. data/lib/rubocop/cop/rspec/cop.rb +2 -66
  19. data/lib/rubocop/cop/rspec/describe_class.rb +21 -30
  20. data/lib/rubocop/cop/rspec/describe_method.rb +14 -6
  21. data/lib/rubocop/cop/rspec/describe_symbol.rb +2 -2
  22. data/lib/rubocop/cop/rspec/described_class.rb +2 -2
  23. data/lib/rubocop/cop/rspec/described_class_module_wrapping.rb +1 -1
  24. data/lib/rubocop/cop/rspec/dialect.rb +1 -1
  25. data/lib/rubocop/cop/rspec/empty_example_group.rb +91 -7
  26. data/lib/rubocop/cop/rspec/empty_hook.rb +1 -1
  27. data/lib/rubocop/cop/rspec/empty_line_after_example.rb +4 -8
  28. data/lib/rubocop/cop/rspec/empty_line_after_example_group.rb +4 -8
  29. data/lib/rubocop/cop/rspec/empty_line_after_final_let.rb +7 -10
  30. data/lib/rubocop/cop/rspec/empty_line_after_hook.rb +4 -8
  31. data/lib/rubocop/cop/rspec/empty_line_after_subject.rb +5 -8
  32. data/lib/rubocop/cop/rspec/example_length.rb +1 -1
  33. data/lib/rubocop/cop/rspec/example_without_description.rb +1 -1
  34. data/lib/rubocop/cop/rspec/example_wording.rb +4 -4
  35. data/lib/rubocop/cop/rspec/expect_actual.rb +1 -1
  36. data/lib/rubocop/cop/rspec/expect_change.rb +1 -1
  37. data/lib/rubocop/cop/rspec/expect_in_hook.rb +1 -1
  38. data/lib/rubocop/cop/rspec/expect_output.rb +1 -1
  39. data/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb +3 -3
  40. data/lib/rubocop/cop/rspec/factory_bot/create_list.rb +10 -6
  41. data/lib/rubocop/cop/rspec/factory_bot/factory_class_name.rb +1 -1
  42. data/lib/rubocop/cop/rspec/file_path.rb +25 -17
  43. data/lib/rubocop/cop/rspec/focus.rb +7 -11
  44. data/lib/rubocop/cop/rspec/hook_argument.rb +5 -6
  45. data/lib/rubocop/cop/rspec/hooks_before_examples.rb +1 -1
  46. data/lib/rubocop/cop/rspec/implicit_block_expectation.rb +1 -1
  47. data/lib/rubocop/cop/rspec/implicit_expect.rb +1 -1
  48. data/lib/rubocop/cop/rspec/implicit_subject.rb +8 -6
  49. data/lib/rubocop/cop/rspec/instance_spy.rb +1 -1
  50. data/lib/rubocop/cop/rspec/instance_variable.rb +1 -1
  51. data/lib/rubocop/cop/rspec/invalid_predicate_matcher.rb +1 -1
  52. data/lib/rubocop/cop/rspec/it_behaves_like.rb +1 -1
  53. data/lib/rubocop/cop/rspec/iterated_expectation.rb +1 -1
  54. data/lib/rubocop/cop/rspec/leading_subject.rb +20 -17
  55. data/lib/rubocop/cop/rspec/leaky_constant_declaration.rb +1 -1
  56. data/lib/rubocop/cop/rspec/let_before_examples.rb +1 -1
  57. data/lib/rubocop/cop/rspec/let_setup.rb +6 -3
  58. data/lib/rubocop/cop/rspec/message_chain.rb +1 -1
  59. data/lib/rubocop/cop/rspec/message_expectation.rb +1 -1
  60. data/lib/rubocop/cop/rspec/message_spies.rb +1 -1
  61. data/lib/rubocop/cop/rspec/missing_example_group_argument.rb +1 -1
  62. data/lib/rubocop/cop/rspec/multiple_describes.rb +11 -8
  63. data/lib/rubocop/cop/rspec/multiple_expectations.rb +7 -11
  64. data/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb +148 -0
  65. data/lib/rubocop/cop/rspec/multiple_subjects.rb +1 -1
  66. data/lib/rubocop/cop/rspec/named_subject.rb +1 -1
  67. data/lib/rubocop/cop/rspec/nested_groups.rb +4 -4
  68. data/lib/rubocop/cop/rspec/not_to_not.rb +1 -1
  69. data/lib/rubocop/cop/rspec/overwriting_setup.rb +1 -1
  70. data/lib/rubocop/cop/rspec/pending.rb +1 -1
  71. data/lib/rubocop/cop/rspec/predicate_matcher.rb +7 -14
  72. data/lib/rubocop/cop/rspec/rails/http_status.rb +1 -1
  73. data/lib/rubocop/cop/rspec/receive_counts.rb +1 -1
  74. data/lib/rubocop/cop/rspec/receive_never.rb +2 -2
  75. data/lib/rubocop/cop/rspec/repeated_description.rb +1 -1
  76. data/lib/rubocop/cop/rspec/repeated_example.rb +2 -2
  77. data/lib/rubocop/cop/rspec/repeated_example_group_body.rb +1 -1
  78. data/lib/rubocop/cop/rspec/repeated_example_group_description.rb +1 -1
  79. data/lib/rubocop/cop/rspec/return_from_stub.rb +1 -1
  80. data/lib/rubocop/cop/rspec/scattered_let.rb +1 -1
  81. data/lib/rubocop/cop/rspec/scattered_setup.rb +1 -1
  82. data/lib/rubocop/cop/rspec/shared_context.rb +1 -1
  83. data/lib/rubocop/cop/rspec/shared_examples.rb +1 -1
  84. data/lib/rubocop/cop/rspec/single_argument_message_chain.rb +1 -1
  85. data/lib/rubocop/cop/rspec/subject_stub.rb +2 -2
  86. data/lib/rubocop/cop/rspec/unspecified_exception.rb +1 -1
  87. data/lib/rubocop/cop/rspec/variable_definition.rb +6 -6
  88. data/lib/rubocop/cop/rspec/variable_name.rb +28 -9
  89. data/lib/rubocop/cop/rspec/verified_doubles.rb +1 -1
  90. data/lib/rubocop/cop/rspec/void_expect.rb +1 -1
  91. data/lib/rubocop/cop/rspec/yield.rb +1 -1
  92. data/lib/rubocop/cop/rspec_cops.rb +1 -0
  93. data/lib/rubocop/rspec/corrector/move_node.rb +7 -5
  94. data/lib/rubocop/rspec/description_extractor.rb +1 -1
  95. data/lib/rubocop/rspec/{blank_line_separation.rb → empty_line_separation.rb} +13 -2
  96. data/lib/rubocop/rspec/example_group.rb +2 -2
  97. data/lib/rubocop/rspec/language.rb +6 -4
  98. data/lib/rubocop/rspec/language/node_pattern.rb +6 -1
  99. data/lib/rubocop/rspec/top_level_describe.rb +2 -2
  100. data/lib/rubocop/rspec/top_level_group.rb +24 -13
  101. data/lib/rubocop/rspec/variable.rb +1 -1
  102. data/lib/rubocop/rspec/version.rb +1 -1
  103. metadata +23 -7
@@ -26,7 +26,7 @@ module RuboCop
26
26
  # let!(:baz) { 3 }
27
27
  # end
28
28
  #
29
- class ScatteredLet < Cop
29
+ class ScatteredLet < Base
30
30
  extend AutoCorrector
31
31
 
32
32
  MSG = 'Group all let/let! blocks in the example group together.'
@@ -22,7 +22,7 @@ module RuboCop
22
22
  # end
23
23
  # end
24
24
  #
25
- class ScatteredSetup < Cop
25
+ class ScatteredSetup < Base
26
26
  MSG = 'Do not define multiple `%<hook_name>s` hooks in the same '\
27
27
  'example group (also defined on %<lines>s).'
28
28
 
@@ -50,7 +50,7 @@ module RuboCop
50
50
  # end
51
51
  # end
52
52
  #
53
- class SharedContext < Cop
53
+ class SharedContext < Base
54
54
  extend AutoCorrector
55
55
 
56
56
  MSG_EXAMPLES = "Use `shared_examples` when you don't "\
@@ -20,7 +20,7 @@ module RuboCop
20
20
  # shared_examples_for 'foo bar baz'
21
21
  # include_examples 'foo bar baz'
22
22
  #
23
- class SharedExamples < Cop
23
+ class SharedExamples < Base
24
24
  extend AutoCorrector
25
25
 
26
26
  def_node_matcher :shared_examples,
@@ -16,7 +16,7 @@ module RuboCop
16
16
  # allow(foo).to receive(:bar, :baz)
17
17
  # allow(foo).to receive("bar.baz")
18
18
  #
19
- class SingleArgumentMessageChain < Cop
19
+ class SingleArgumentMessageChain < Base
20
20
  extend AutoCorrector
21
21
 
22
22
  MSG = 'Use `%<recommended>s` instead of calling '\
@@ -21,7 +21,7 @@ module RuboCop
21
21
  # end
22
22
  # end
23
23
  #
24
- class SubjectStub < Cop
24
+ class SubjectStub < Base
25
25
  include RuboCop::RSpec::TopLevelGroup
26
26
 
27
27
  MSG = 'Do not stub methods of the object under test.'
@@ -39,7 +39,7 @@ module RuboCop
39
39
  # name # => :thing
40
40
  # end
41
41
  #
42
- # @param node [RuboCop::Node]
42
+ # @param node [RuboCop::AST::Node]
43
43
  #
44
44
  # @yield [Symbol] subject name
45
45
  def_node_matcher :subject, <<-PATTERN
@@ -30,7 +30,7 @@ module RuboCop
30
30
  # }.to raise_error(/err/)
31
31
  #
32
32
  # expect { do_something }.not_to raise_error
33
- class UnspecifiedException < Cop
33
+ class UnspecifiedException < Base
34
34
  MSG = 'Specify the exception being captured'
35
35
 
36
36
  def_node_matcher :empty_raise_error_or_exception, <<-PATTERN
@@ -7,22 +7,22 @@ module RuboCop
7
7
  #
8
8
  # @example EnforcedStyle: symbols (default)
9
9
  # # bad
10
- # let('user_name') { 'Adam' }
11
10
  # subject('user') { create_user }
11
+ # let('user_name') { 'Adam' }
12
12
  #
13
13
  # # good
14
- # let(:user_name) { 'Adam' }
15
14
  # subject(:user) { create_user }
15
+ # let(:user_name) { 'Adam' }
16
16
  #
17
17
  # @example EnforcedStyle: strings
18
18
  # # bad
19
- # let(:user_name) { 'Adam' }
20
19
  # subject(:user) { create_user }
20
+ # let(:user_name) { 'Adam' }
21
21
  #
22
22
  # # good
23
- # let('user_name') { 'Adam' }
24
23
  # subject('user') { create_user }
25
- class VariableDefinition < Cop
24
+ # let('user_name') { 'Adam' }
25
+ class VariableDefinition < Base
26
26
  include ConfigurableEnforcedStyle
27
27
  include RuboCop::RSpec::Variable
28
28
 
@@ -44,7 +44,7 @@ module RuboCop
44
44
  end
45
45
 
46
46
  def string?(node)
47
- node.str_type? || node.dstr_type?
47
+ node.str_type?
48
48
  end
49
49
 
50
50
  def symbol?(node)
@@ -5,25 +5,43 @@ module RuboCop
5
5
  module RSpec
6
6
  # Checks that memoized helper names use the configured style.
7
7
  #
8
+ # Variables can be excluded from checking using the `IgnoredPatterns`
9
+ # option.
10
+ #
8
11
  # @example EnforcedStyle: snake_case (default)
9
12
  # # bad
10
- # let(:userName) { 'Adam' }
11
- # subject(:userName) { 'Adam' }
13
+ # subject(:userName1) { 'Adam' }
14
+ # let(:userName2) { 'Adam' }
12
15
  #
13
16
  # # good
14
- # let(:user_name) { 'Adam' }
15
- # subject(:user_name) { 'Adam' }
17
+ # subject(:user_name_1) { 'Adam' }
18
+ # let(:user_name_2) { 'Adam' }
16
19
  #
17
20
  # @example EnforcedStyle: camelCase
18
21
  # # bad
19
- # let(:user_name) { 'Adam' }
20
- # subject(:user_name) { 'Adam' }
22
+ # subject(:user_name_1) { 'Adam' }
23
+ # let(:user_name_2) { 'Adam' }
21
24
  #
22
25
  # # good
23
- # let(:userName) { 'Adam' }
24
- # subject(:userName) { 'Adam' }
25
- class VariableName < Cop
26
+ # subject(:userName1) { 'Adam' }
27
+ # let(:userName2) { 'Adam' }
28
+ #
29
+ # @example IgnoredPatterns configuration
30
+ #
31
+ # # rubocop.yml
32
+ # # RSpec/VariableName:
33
+ # # EnforcedStyle: snake_case
34
+ # # IgnoredPatterns:
35
+ # # - ^userFood
36
+ #
37
+ # @example
38
+ # # okay because it matches the `^userFood` regex in `IgnoredPatterns`
39
+ # subject(:userFood_1) { 'spaghetti' }
40
+ # let(:userFood_2) { 'fettuccine' }
41
+ #
42
+ class VariableName < Base
26
43
  include ConfigurableNaming
44
+ include IgnoredPattern
27
45
  include RuboCop::RSpec::Variable
28
46
 
29
47
  MSG = 'Use %<style>s for variable names.'
@@ -31,6 +49,7 @@ module RuboCop
31
49
  def on_send(node)
32
50
  variable_definition?(node) do |variable|
33
51
  return if variable.dstr_type? || variable.dsym_type?
52
+ return if matches_ignored_pattern?(variable.value)
34
53
 
35
54
  check_name(node, variable.value, variable.loc.expression)
36
55
  end
@@ -22,7 +22,7 @@ module RuboCop
22
22
  # let(:foo) do
23
23
  # instance_double("ClassName", method_name: 'returned value')
24
24
  # end
25
- class VerifiedDoubles < Cop
25
+ class VerifiedDoubles < Base
26
26
  MSG = 'Prefer using verifying doubles over normal doubles.'
27
27
 
28
28
  def_node_matcher :unverified_double, <<-PATTERN
@@ -11,7 +11,7 @@ module RuboCop
11
11
  #
12
12
  # # good
13
13
  # expect(something).to be(1)
14
- class VoidExpect < Cop
14
+ class VoidExpect < Base
15
15
  MSG = 'Do not use `expect()` without `.to` or `.not_to`. ' \
16
16
  'Chain the methods or remove it.'
17
17
 
@@ -11,7 +11,7 @@ module RuboCop
11
11
  #
12
12
  # # good
13
13
  # expect(foo).to be(:bar).and_yield(1)
14
- class Yield < Cop
14
+ class Yield < Base
15
15
  extend AutoCorrector
16
16
  include RangeHelp
17
17
 
@@ -65,6 +65,7 @@ require_relative 'rspec/message_spies'
65
65
  require_relative 'rspec/missing_example_group_argument'
66
66
  require_relative 'rspec/multiple_describes'
67
67
  require_relative 'rspec/multiple_expectations'
68
+ require_relative 'rspec/multiple_memoized_helpers'
68
69
  require_relative 'rspec/multiple_subjects'
69
70
  require_relative 'rspec/named_subject'
70
71
  require_relative 'rspec/nested_groups'
@@ -16,19 +16,21 @@ module RuboCop
16
16
  @processed_source = processed_source # used by RangeHelp
17
17
  end
18
18
 
19
- def move_before(other) # rubocop:disable Metrics/AbcSize
19
+ def move_before(other)
20
20
  position = other.loc.expression
21
- indent = "\n" + ' ' * other.loc.column
21
+ indent = ' ' * other.loc.column
22
+ newline_indent = "\n#{indent}"
22
23
 
23
- corrector.insert_before(position, source(original) + indent)
24
+ corrector.insert_before(position, source(original) + newline_indent)
24
25
  corrector.remove(node_range_with_surrounding_space(original))
25
26
  end
26
27
 
27
28
  def move_after(other)
28
29
  position = final_end_location(other)
29
- indent = "\n" + ' ' * other.loc.column
30
+ indent = ' ' * other.loc.column
31
+ newline_indent = "\n#{indent}"
30
32
 
31
- corrector.insert_after(position, indent + source(original))
33
+ corrector.insert_after(position, newline_indent + source(original))
32
34
  corrector.remove(node_range_with_surrounding_space(original))
33
35
  end
34
36
 
@@ -21,7 +21,7 @@ module RuboCop
21
21
 
22
22
  # Decorator of a YARD code object for working with documented rspec cops
23
23
  class CodeObject
24
- COP_CLASS_NAME = 'RuboCop::Cop::RSpec::Cop'
24
+ COP_CLASS_NAME = 'RuboCop::Cop::RSpec::Base'
25
25
  RSPEC_NAMESPACE = 'RuboCop::Cop::RSpec'
26
26
 
27
27
  def initialize(yardoc)
@@ -2,12 +2,23 @@
2
2
 
3
3
  module RuboCop
4
4
  module RSpec
5
- # Helps determine the offending location if there is not a blank line
5
+ # Helps determine the offending location if there is not an empty line
6
6
  # following the node. Allows comments to follow directly after.
7
- module BlankLineSeparation
7
+ module EmptyLineSeparation
8
8
  include FinalEndLocation
9
9
  include RuboCop::Cop::RangeHelp
10
10
 
11
+ def missing_separating_line_offense(node)
12
+ return if last_child?(node)
13
+
14
+ missing_separating_line(node) do |location|
15
+ msg = yield(node.method_name)
16
+ add_offense(location, message: msg) do |corrector|
17
+ corrector.insert_after(location.end, "\n")
18
+ end
19
+ end
20
+ end
21
+
11
22
  def missing_separating_line(node)
12
23
  line = final_end_location(node).line
13
24
 
@@ -36,9 +36,9 @@ module RuboCop
36
36
  #
37
37
  # Searches node and halts when a scope change is detected
38
38
  #
39
- # @param node [RuboCop::Node] node to recursively search
39
+ # @param node [RuboCop::AST::Node] node to recursively search
40
40
  #
41
- # @return [Array<RuboCop::Node>] discovered nodes
41
+ # @return [Array<RuboCop::AST::Node>] discovered nodes
42
42
  def find_all_in_scope(node, predicate)
43
43
  node.each_child_node.flat_map do |child|
44
44
  find_all(child, predicate)
@@ -4,8 +4,6 @@ module RuboCop
4
4
  module RSpec
5
5
  # RSpec public API methods that are commonly used in cops
6
6
  module Language
7
- RSPEC = '{(const {nil? cbase} :RSpec) nil?}'
8
-
9
7
  # Set of method selectors
10
8
  class SelectorSet
11
9
  def initialize(selectors)
@@ -29,7 +27,7 @@ module RuboCop
29
27
  end
30
28
 
31
29
  def block_pass_pattern
32
- "(send #{RSPEC} #{node_pattern_union} _ block_pass)"
30
+ "(send #rspec? #{node_pattern_union} _ block_pass)"
33
31
  end
34
32
 
35
33
  def block_or_block_pass_pattern
@@ -37,7 +35,11 @@ module RuboCop
37
35
  end
38
36
 
39
37
  def send_pattern
40
- "(send #{RSPEC} #{node_pattern_union} ...)"
38
+ "(send #rspec? #{node_pattern_union} ...)"
39
+ end
40
+
41
+ def send_or_block_or_block_pass_pattern
42
+ "{#{send_pattern} #{block_pattern} #{block_pass_pattern}}"
41
43
  end
42
44
 
43
45
  def node_pattern_union
@@ -7,6 +7,8 @@ module RuboCop
7
7
  module NodePattern
8
8
  extend RuboCop::NodePattern::Macros
9
9
 
10
+ def_node_matcher :rspec?, '{(const {nil? cbase} :RSpec) nil?}'
11
+
10
12
  def_node_matcher :example_group?, ExampleGroups::ALL.block_pattern
11
13
  def_node_matcher :shared_group?, SharedGroups::ALL.block_pattern
12
14
 
@@ -14,7 +16,7 @@ module RuboCop
14
16
  def_node_matcher :spec_group?, spec_groups.block_pattern
15
17
 
16
18
  def_node_matcher :example_group_with_body?, <<-PATTERN
17
- (block #{ExampleGroups::ALL.send_pattern} args [!nil?])
19
+ (block #{ExampleGroups::ALL.send_pattern} args !nil?)
18
20
  PATTERN
19
21
 
20
22
  def_node_matcher :example?, Examples::ALL.block_pattern
@@ -23,6 +25,9 @@ module RuboCop
23
25
 
24
26
  def_node_matcher :let?, Helpers::ALL.block_or_block_pass_pattern
25
27
 
28
+ def_node_matcher :include?,
29
+ Includes::ALL.send_or_block_or_block_pass_pattern
30
+
26
31
  def_node_matcher :subject?, Subject::ALL.block_pattern
27
32
  end
28
33
  end
@@ -16,7 +16,7 @@ module RuboCop
16
16
  private
17
17
 
18
18
  def top_level_describe?(node)
19
- return false unless node.method_name == :describe
19
+ return false unless node.method?(:describe)
20
20
 
21
21
  top_level_nodes.include?(node)
22
22
  end
@@ -44,7 +44,7 @@ module RuboCop
44
44
 
45
45
  def describe_statement_children(node)
46
46
  node.each_child_node(:send).select do |element|
47
- element.method_name == :describe
47
+ element.method?(:describe)
48
48
  end
49
49
  end
50
50
  end
@@ -10,29 +10,40 @@ module RuboCop
10
10
  def_node_matcher :example_or_shared_group?,
11
11
  (ExampleGroups::ALL + SharedGroups::ALL).block_pattern
12
12
 
13
- def on_block(node)
14
- return unless respond_to?(:on_top_level_group)
15
- return unless top_level_group?(node)
13
+ def on_new_investigation
14
+ super
16
15
 
17
- on_top_level_group(node)
16
+ return unless root_node
17
+
18
+ top_level_groups.each do |node|
19
+ example_group?(node, &method(:on_top_level_example_group))
20
+ on_top_level_group(node)
21
+ end
22
+ end
23
+
24
+ def top_level_groups
25
+ @top_level_groups ||=
26
+ top_level_nodes(root_node).select { |n| example_or_shared_group?(n) }
18
27
  end
19
28
 
20
29
  private
21
30
 
31
+ # Dummy methods to be overridden in the consumer
32
+ def on_top_level_example_group; end
33
+
34
+ def on_top_level_group; end
35
+
22
36
  def top_level_group?(node)
23
37
  top_level_groups.include?(node)
24
38
  end
25
39
 
26
- def top_level_groups
27
- @top_level_groups ||=
28
- top_level_nodes.select { |n| example_or_shared_group?(n) }
29
- end
30
-
31
- def top_level_nodes
32
- if root_node.begin_type?
33
- root_node.children
40
+ def top_level_nodes(node)
41
+ if node.begin_type?
42
+ node.children
43
+ elsif node.module_type? || node.class_type?
44
+ top_level_nodes(node.body)
34
45
  else
35
- [root_node]
46
+ [node]
36
47
  end
37
48
  end
38
49
 
@@ -8,7 +8,7 @@ module RuboCop
8
8
  extend RuboCop::NodePattern::Macros
9
9
 
10
10
  def_node_matcher :variable_definition?, <<~PATTERN
11
- (send #{RSPEC} #{(Helpers::ALL + Subject::ALL).node_pattern_union}
11
+ (send nil? #{(Helpers::ALL + Subject::ALL).node_pattern_union}
12
12
  $({sym str dsym dstr} ...) ...)
13
13
  PATTERN
14
14
  end
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module RSpec
5
5
  # Version information for the RSpec RuboCop plugin.
6
6
  module Version
7
- STRING = '1.42.0'
7
+ STRING = '1.43.0'
8
8
  end
9
9
  end
10
10
  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.42.0
4
+ version: 1.43.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Backus
@@ -10,22 +10,22 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-07-09 00:00:00.000000000 Z
13
+ date: 2020-08-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rubocop
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - ">="
19
+ - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: 0.87.0
21
+ version: '0.87'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
- - - ">="
26
+ - - "~>"
27
27
  - !ruby/object:Gem::Version
28
- version: 0.87.0
28
+ version: '0.87'
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: rack
31
31
  requirement: !ruby/object:Gem::Requirement
@@ -68,6 +68,20 @@ dependencies:
68
68
  - - ">="
69
69
  - !ruby/object:Gem::Version
70
70
  version: '3.4'
71
+ - !ruby/object:Gem::Dependency
72
+ name: rubocop-performance
73
+ requirement: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - "~>"
76
+ - !ruby/object:Gem::Version
77
+ version: '1.7'
78
+ type: :development
79
+ prerelease: false
80
+ version_requirements: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - "~>"
83
+ - !ruby/object:Gem::Version
84
+ version: '1.7'
71
85
  - !ruby/object:Gem::Dependency
72
86
  name: simplecov
73
87
  requirement: !ruby/object:Gem::Requirement
@@ -119,6 +133,7 @@ files:
119
133
  - lib/rubocop/cop/rspec/align_right_let_brace.rb
120
134
  - lib/rubocop/cop/rspec/any_instance.rb
121
135
  - lib/rubocop/cop/rspec/around_block.rb
136
+ - lib/rubocop/cop/rspec/base.rb
122
137
  - lib/rubocop/cop/rspec/be.rb
123
138
  - lib/rubocop/cop/rspec/be_eql.rb
124
139
  - lib/rubocop/cop/rspec/before_after_all.rb
@@ -173,6 +188,7 @@ files:
173
188
  - lib/rubocop/cop/rspec/missing_example_group_argument.rb
174
189
  - lib/rubocop/cop/rspec/multiple_describes.rb
175
190
  - lib/rubocop/cop/rspec/multiple_expectations.rb
191
+ - lib/rubocop/cop/rspec/multiple_memoized_helpers.rb
176
192
  - lib/rubocop/cop/rspec/multiple_subjects.rb
177
193
  - lib/rubocop/cop/rspec/named_subject.rb
178
194
  - lib/rubocop/cop/rspec/nested_groups.rb
@@ -203,11 +219,11 @@ files:
203
219
  - lib/rubocop/cop/rspec_cops.rb
204
220
  - lib/rubocop/rspec.rb
205
221
  - lib/rubocop/rspec/align_let_brace.rb
206
- - lib/rubocop/rspec/blank_line_separation.rb
207
222
  - lib/rubocop/rspec/concept.rb
208
223
  - lib/rubocop/rspec/config_formatter.rb
209
224
  - lib/rubocop/rspec/corrector/move_node.rb
210
225
  - lib/rubocop/rspec/description_extractor.rb
226
+ - lib/rubocop/rspec/empty_line_separation.rb
211
227
  - lib/rubocop/rspec/example.rb
212
228
  - lib/rubocop/rspec/example_group.rb
213
229
  - lib/rubocop/rspec/factory_bot.rb