From d7d062b2955bbf0c5e2c8d9dcfc1cbc17943fb37 Mon Sep 17 00:00:00 2001 From: Phil Pirozhkov Date: Wed, 10 Feb 2021 22:06:46 +0300 Subject: [PATCH 1/2] Remove deprecated `match_regex` matcher --- Changelog.md | 1 + lib/rspec/matchers.rb | 6 ------ spec/rspec/matchers/aliases_spec.rb | 8 -------- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/Changelog.md b/Changelog.md index 374d20980..50f4e1166 100644 --- a/Changelog.md +++ b/Changelog.md @@ -13,6 +13,7 @@ Breaking Changes: * Remove support for present-tense dynamic predicate. (Phil Pirozhkov, #1286) * Prevent implicit blocks (e.g blocks as values) from being used with block matchers. (Phil Pirozhkov, #1285) +* Remove deprecated `match_regex` matcher. (Phil Pirozhkov, #1288) Enhancements: diff --git a/lib/rspec/matchers.rb b/lib/rspec/matchers.rb index 114c176ee..0a0073e3b 100644 --- a/lib/rspec/matchers.rb +++ b/lib/rspec/matchers.rb @@ -687,15 +687,9 @@ def all(expected) # :c => { :d => (a_value < 3) } # } # ) - # - # @note The `match_regex` alias is deprecated and is not recommended for use. - # It was added in 2.12.1 to facilitate its use from within custom - # matchers (due to how the custom matcher DSL was evaluated in 2.x, - # `match` could not be used there), but is no longer needed in 3.x. def match(expected) BuiltIn::Match.new(expected) end - alias_matcher :match_regex, :match alias_matcher :an_object_matching, :match alias_matcher :a_string_matching, :match alias_matcher :matching, :match diff --git a/spec/rspec/matchers/aliases_spec.rb b/spec/rspec/matchers/aliases_spec.rb index 5e4698ae7..ef5400ba6 100644 --- a/spec/rspec/matchers/aliases_spec.rb +++ b/spec/rspec/matchers/aliases_spec.rb @@ -276,14 +276,6 @@ module RSpec ).with_description('an object matching /foo/') end - specify do - expect( - match_regex(/foo/) - ).to be_aliased_to( - match(/foo/) - ).with_description('match regex /foo/') - end - specify do expect( matching(/foo/) From 1270e00ddaea43d31ff3898aea72c0bcfa932267 Mon Sep 17 00:00:00 2001 From: Phil Pirozhkov Date: Wed, 10 Feb 2021 22:09:30 +0300 Subject: [PATCH 2/2] Remove deprecated `StartAndEndWith` matcher base class --- Changelog.md | 1 + lib/rspec/matchers/built_in/start_or_end_with.rb | 6 ------ 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/Changelog.md b/Changelog.md index 50f4e1166..63201afda 100644 --- a/Changelog.md +++ b/Changelog.md @@ -14,6 +14,7 @@ Breaking Changes: * Prevent implicit blocks (e.g blocks as values) from being used with block matchers. (Phil Pirozhkov, #1285) * Remove deprecated `match_regex` matcher. (Phil Pirozhkov, #1288) +* Remove deprecated `StartAndEndWith` matcher base class. (Phil Pirozhkov, #1288) Enhancements: diff --git a/lib/rspec/matchers/built_in/start_or_end_with.rb b/lib/rspec/matchers/built_in/start_or_end_with.rb index 81f06c288..95645fe6d 100644 --- a/lib/rspec/matchers/built_in/start_or_end_with.rb +++ b/lib/rspec/matchers/built_in/start_or_end_with.rb @@ -54,12 +54,6 @@ def subsets_comparable? end end - # For RSpec 3.1, the base class was named `StartAndEndWith`. For SemVer reasons, - # we still provide this constant until 4.0. - # @deprecated Use StartOrEndWith instead. - # @private - StartAndEndWith = StartOrEndWith - # @api private # Provides the implementation for `start_with`. # Not intended to be instantiated directly.