class RSpec::Matchers::BuiltIn::ChangeToValue
@api private Used to specify a change to a specific value (and, optionally, from a specific value).
Public Class Methods
new(change_details, expected_after)
click to toggle source
Calls superclass method
RSpec::Matchers::BuiltIn::SpecificValuesChange::new
# File lib/rspec/matchers/built_in/change.rb, line 312 def initialize(change_details, expected_after) @description_suffix = nil super(change_details, MATCH_ANYTHING, expected_after) end
Public Instance Methods
does_not_match?(_event_proc)
click to toggle source
@private
# File lib/rspec/matchers/built_in/change.rb, line 326 def does_not_match?(_event_proc) raise NotImplementedError, "`expect { }.not_to change { }.to()` " \ "is not supported" end
from(value)
click to toggle source
@api public Specifies the original value.
# File lib/rspec/matchers/built_in/change.rb, line 319 def from(value) @expected_before = value @description_suffix = " from #{description_of value}" self end
Private Instance Methods
change_description()
click to toggle source
# File lib/rspec/matchers/built_in/change.rb, line 333 def change_description "to #{description_of @expected_after}#{@description_suffix}" end