Skip to content

Commit

Permalink
Disable InternalAffairs/NumblockHandler for `RSpec/FactoryBot/Creat…
Browse files Browse the repository at this point in the history
  • Loading branch information
ydah committed Aug 17, 2022
1 parent 009c4df commit b3b0678
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rubocop/cop/factory_bot/create_list.rb
Expand Up @@ -71,7 +71,7 @@ class CreateList < Base
(send {nil? #factory_bot?} :create_list (sym _) (int $_) ...)
PATTERN

def on_block(node)
def on_block(node) # rubocop:todo InternalAffairs/NumblockHandler
return unless style == :create_list

return unless n_times_block?(node)
Expand Down
8 changes: 8 additions & 0 deletions spec/rubocop/cop/factory_bot/create_list_spec.rb
Expand Up @@ -230,5 +230,13 @@
SomeFactory.create_list :user, 3
RUBY
end

context 'when Ruby 2.7', :ruby27 do
it 'ignores n.times with numblock' do
expect_no_offenses(<<~RUBY)
3.times { create :user, position: _1 }
RUBY
end
end
end
end

0 comments on commit b3b0678

Please sign in to comment.