From f42a07d2c567f6ce5e2ba388d96cea1e552188bc Mon Sep 17 00:00:00 2001 From: amalrik maia Date: Tue, 19 Dec 2023 12:04:18 +0000 Subject: [PATCH] closes #1462 - Remove the with qualifier on define_enum_for matcher --- .../active_record/define_enum_for_matcher.rb | 8 -------- .../define_enum_for_matcher_spec.rb | 18 ------------------ 2 files changed, 26 deletions(-) diff --git a/lib/shoulda/matchers/active_record/define_enum_for_matcher.rb b/lib/shoulda/matchers/active_record/define_enum_for_matcher.rb index 18379522a..81539614a 100644 --- a/lib/shoulda/matchers/active_record/define_enum_for_matcher.rb +++ b/lib/shoulda/matchers/active_record/define_enum_for_matcher.rb @@ -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 diff --git a/spec/unit/shoulda/matchers/active_record/define_enum_for_matcher_spec.rb b/spec/unit/shoulda/matchers/active_record/define_enum_for_matcher_spec.rb index 8e4190aeb..1b51dcc01 100644 --- a/spec/unit/shoulda/matchers/active_record/define_enum_for_matcher_spec.rb +++ b/spec/unit/shoulda/matchers/active_record/define_enum_for_matcher_spec.rb @@ -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