Class: RuboCop::Cop::RSpec::FactoryBot::ConsistentParenthesesStyle

Inherits:
Base
  • Object
show all
Defined in:
lib/rubocop/cop/rspec/factory_bot/consistent_parentheses_style.rb

Overview

Use a consistent style for parentheses in factory bot calls.

Examples:


# bad
create :user
build(:user)
create(:login)
create :login

‘EnforcedStyle: require_parentheses` (default)


# good
create(:user)
create(:user)
create(:login)
build(:login)

‘EnforcedStyle: omit_parentheses`


# good
create :user
build :user
create :login
create :login

# also good
# when method name and first argument are not on same line
create(
  :user
)
build(
  :user,
  name: 'foo'
)