Skip to content

Commit

Permalink
Rename StartAndEndWith to StartOrEndWith.
Browse files Browse the repository at this point in the history
After all, it does one or the other, not both.
  • Loading branch information
myronmarston committed Jan 21, 2015
1 parent d467141 commit 3bc50c5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/rspec/matchers/built_in.rb
Expand Up @@ -24,7 +24,7 @@ module BuiltIn
autoload :Compound, 'rspec/matchers/built_in/compound'
autoload :ContainExactly, 'rspec/matchers/built_in/contain_exactly'
autoload :Cover, 'rspec/matchers/built_in/cover'
autoload :EndWith, 'rspec/matchers/built_in/start_and_end_with'
autoload :EndWith, 'rspec/matchers/built_in/start_or_end_with'
autoload :Eq, 'rspec/matchers/built_in/eq'
autoload :Eql, 'rspec/matchers/built_in/eql'
autoload :Equal, 'rspec/matchers/built_in/equal'
Expand All @@ -41,7 +41,7 @@ module BuiltIn
autoload :RaiseError, 'rspec/matchers/built_in/raise_error'
autoload :RespondTo, 'rspec/matchers/built_in/respond_to'
autoload :Satisfy, 'rspec/matchers/built_in/satisfy'
autoload :StartWith, 'rspec/matchers/built_in/start_and_end_with'
autoload :StartWith, 'rspec/matchers/built_in/start_or_end_with'
autoload :ThrowSymbol, 'rspec/matchers/built_in/throw_symbol'
autoload :YieldControl, 'rspec/matchers/built_in/yield'
autoload :YieldSuccessiveArgs, 'rspec/matchers/built_in/yield'
Expand Down
Expand Up @@ -4,7 +4,7 @@ module BuiltIn
# @api private
# Base class for the `end_with` and `start_with` matchers.
# Not intended to be instantiated directly.
class StartAndEndWith < BaseMatcher
class StartOrEndWith < BaseMatcher
def initialize(*expected)
@actual_does_not_have_ordered_elements = false
@expected = expected.length == 1 ? expected.first : expected
Expand Down Expand Up @@ -52,10 +52,16 @@ 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.
class StartWith < StartAndEndWith
class StartWith < StartOrEndWith
private

def subset_matches?
Expand All @@ -70,7 +76,7 @@ def element_matches?
# @api private
# Provides the implementation for `end_with`.
# Not intended to be instantiated directly.
class EndWith < StartAndEndWith
class EndWith < StartOrEndWith
private

def subset_matches?
Expand Down

0 comments on commit 3bc50c5

Please sign in to comment.