class RSpec::Matchers::BuiltIn::ChangeRelatively
@api private
Used to specify a relative change.
def description
- Private: -
def description "change #{@change_details.value_representation} " \ "#{@relativity.to_s.tr('_', ' ')} #{description_of @expected_delta}" end
def does_not_match?(_event_proc)
- Private: -
def does_not_match?(_event_proc) raise NotImplementedError, "`expect { }.not_to change " \ "{ }.#{@relativity}()` is not supported" end
def failure_message
- Private: -
def failure_message "expected #{@change_details.value_representation} to have changed " \ "#{@relativity.to_s.tr('_', ' ')} " \ "#{description_of @expected_delta}, but #{failure_reason}" end
def failure_reason
def failure_reason return "was not given a block" unless Proc === @event_proc "was changed by #{description_of @change_details.actual_delta}" end
def initialize(change_details, expected_delta, relativity, &comparer)
def initialize(change_details, expected_delta, relativity, &comparer) @change_details = change_details @expected_delta = expected_delta @relativity = relativity @comparer = comparer end
def matches?(event_proc)
- Private: -
def matches?(event_proc) @event_proc = event_proc @change_details.perform_change(event_proc) && @comparer.call(@change_details.actual_delta) end
def supports_block_expectations?
- Private: -
def supports_block_expectations? true end
def supports_value_expectations?
- Private: -
def supports_value_expectations? false end