Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary captures in CreateList #959

Merged
merged 1 commit into from Jul 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/rubocop/cop/rspec/factory_bot/create_list.rb
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