class RSpec::Matchers::BuiltIn::ChangeFromValue
(and, optionally, to a specific value).
Used to specify a change from a specific value
@api private
def change_description
def change_description "from #{description_of @expected_before}#{@description_suffix}" end
def does_not_match?(event_proc)
- Private: -
def does_not_match?(event_proc) if @description_suffix raise NotImplementedError, "`expect { }.not_to change { }.to()` " \ "is not supported" end perform_change(event_proc) && !@change_details.changed? && @matches_before end
def failure_message_when_negated
- Private: -
def failure_message_when_negated return not_given_a_block_failure unless Proc === @event_proc return before_value_failure unless @matches_before did_change_failure end
def initialize(change_details, expected_before)
def initialize(change_details, expected_before) @description_suffix = nil super(change_details, expected_before, MATCH_ANYTHING) end
def to(value)
- Api: - public
def to(value) @expected_after = value @description_suffix = " to #{description_of value}" self end