Skip to content

Commit

Permalink
Fix RuboCop offenses
Browse files Browse the repository at this point in the history
These were introduced after #1358 was merged. Rather bizarrely,
RuboCop didn't run when the PR was opened.
  • Loading branch information
thealiilman authored and mcmire committed Dec 14, 2020
1 parent 63b6321 commit 9b0b5c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions lib/shoulda/matchers/active_record/have_db_column_matcher.rb
Expand Up @@ -84,7 +84,7 @@ def have_db_column(column)

# @private
class HaveDbColumnMatcher
OPTIONS = %i(precision limit default null scale primary)
OPTIONS = %i(precision limit default null scale primary).freeze

def initialize(column)
@column = column
Expand Down Expand Up @@ -147,7 +147,10 @@ def description
def validate_options(opts)
invalid_options = opts.keys.map(&:to_sym) - OPTIONS
if invalid_options.any?
raise ArgumentError, "Unknown option(s): #{invalid_options.map(&:inspect).join(", ")}"
raise(
ArgumentError,
"Unknown option(s): #{invalid_options.map(&:inspect).join(', ')}",
)
end
end

Expand Down
Expand Up @@ -102,7 +102,7 @@
it 'raises an error with the unknown options' do
expect {
have_db_column(:salary).with_options(preccision: 5, primaryy: true)
}.to raise_error("Unknown option(s): :preccision, :primaryy")
}.to raise_error('Unknown option(s): :preccision, :primaryy')
end
end

Expand Down

0 comments on commit 9b0b5c9

Please sign in to comment.