Class: RSpec::Matchers::BuiltIn::SpecificValuesChange Private
- Inherits:
-
BaseMatcher
- Object
- BaseMatcher
- RSpec::Matchers::BuiltIn::SpecificValuesChange
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/matchers/built_in/change.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Base class for specifying a change from and/or to specific values.
Direct Known Subclasses
Constant Summary collapse
- MATCH_ANYTHING =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
::Object.ancestors.last
Constants inherited from BaseMatcher
Instance Attribute Summary
Attributes inherited from BaseMatcher
#actual, #expected, #matcher_name, #rescued_exception
Instance Method Summary collapse
- #description ⇒ Object private
- #failure_message ⇒ Object private
-
#initialize(change_details, from, to) ⇒ SpecificValuesChange
constructor
private
A new instance of SpecificValuesChange.
- #matches?(event_proc) ⇒ Boolean private
- #supports_block_expectations? ⇒ Boolean private
- #supports_value_expectations? ⇒ Boolean private
Methods inherited from BaseMatcher
#actual_formatted, #diffable?, #expected_formatted, #expects_call_stack_jump?, #match_unless_raises, matcher_name
Methods included from BaseMatcher::DefaultFailureMessages
#failure_message_when_negated, has_default_failure_messages?
Methods included from BaseMatcher::HashFormatting
Methods included from Composable
#===, #and, #description_of, #or, should_enumerate?, surface_descriptions_in, unreadable_io?, #values_match?
Constructor Details
#initialize(change_details, from, to) ⇒ SpecificValuesChange
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of SpecificValuesChange.
185 186 187 188 189 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/matchers/built_in/change.rb', line 185 def initialize(change_details, from, to) @change_details = change_details @expected_before = from @expected_after = to end |
Instance Method Details
#description ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
197 198 199 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/matchers/built_in/change.rb', line 197 def description "change #{@change_details.value_representation} #{change_description}" end |
#failure_message ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
202 203 204 205 206 207 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/matchers/built_in/change.rb', line 202 def return not_given_a_block_failure unless Proc === @event_proc return before_value_failure unless @matches_before return did_not_change_failure unless @change_details.changed? after_value_failure end |
#matches?(event_proc) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
192 193 194 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/matchers/built_in/change.rb', line 192 def matches?(event_proc) perform_change(event_proc) && @change_details.changed? && @matches_before && matches_after? end |
#supports_block_expectations? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
210 211 212 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/matchers/built_in/change.rb', line 210 def supports_block_expectations? true end |
#supports_value_expectations? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
215 216 217 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/matchers/built_in/change.rb', line 215 def supports_value_expectations? false end |