Skip to content

Commit

Permalink
Remove unnecessary captures in CreateList
Browse files Browse the repository at this point in the history
  • Loading branch information
bquorning committed Jul 10, 2020
1 parent cd69228 commit cd24b69
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rubocop/cop/rspec/factory_bot/create_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class CreateList < Cop
PATTERN

def_node_matcher :factory_list_call, <<-PATTERN
(send ${(const nil? {:FactoryGirl :FactoryBot}) nil?} :create_list (sym $_) (int $_) $...)
(send {(const nil? {:FactoryGirl :FactoryBot}) nil?} :create_list (sym _) (int $_) ...)
PATTERN

def on_block(node)
Expand All @@ -60,7 +60,7 @@ def on_block(node)
def on_send(node)
return unless style == :n_times

factory_list_call(node) do |_receiver, _factory, count, _|
factory_list_call(node) do |count|
message = format(MSG_N_TIMES, number: count)
add_offense(node.loc.selector, message: message) do |corrector|
TimesCorrector.new(node).call(corrector)
Expand Down

0 comments on commit cd24b69

Please sign in to comment.