Skip to content

Commit

Permalink
refactor: Remove the with qualifier on define_enum_for matcher (#1589)
Browse files Browse the repository at this point in the history
  • Loading branch information
amalrik authored Dec 20, 2023
1 parent 3821caa commit 4886266
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
8 changes: 0 additions & 8 deletions lib/shoulda/matchers/active_record/define_enum_for_matcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,6 @@ def with_values(expected_enum_values)
self
end

def with(expected_enum_values)
Shoulda::Matchers.warn_about_deprecated_method(
'The `with` qualifier on `define_enum_for`',
'`with_values`',
)
with_values(expected_enum_values)
end

def with_prefix(expected_prefix = true)
options[:prefix] = expected_prefix
self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,24 +297,6 @@ def self.statuses
end
end

context 'with values specified using #with' do
it 'produces a warning' do
record = build_record_with_array_values(
attribute_name: :attr,
values: [:foo, :bar],
)

assertion = lambda do
expect(record).to define_enum_for(:attr).with([:foo, :bar])
end

expect(&assertion).to deprecate(
'The `with` qualifier on `define_enum_for`',
'`with_values`',
)
end
end

describe 'with the backing column specified to be of some type' do
context 'if the column storing the attribute is of a different type' do
it 'rejects with an appropriate failure message' do
Expand Down

0 comments on commit 4886266

Please sign in to comment.