Class: RSpec::Expectations::ValueExpectationTarget

Inherits:
ExpectationTarget show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/expectations/expectation_target.rb

Overview

Validates the provided matcher to ensure it supports block expectations, in order to avoid user confusion when they use a block thinking the expectation will be on the return value of the block rather than the block itself.

Constant Summary

Constants inherited from ExpectationTarget

ExpectationTarget::UndefinedValue

Instance Attribute Summary

Attributes inherited from ExpectationTarget

#target

Instance Method Summary collapse

Methods inherited from ExpectationTarget

for, #initialize

Constructor Details

This class inherits a constructor from RSpec::Expectations::ExpectationTarget

Instance Method Details

#not_to(matcher = nil, message = nil, &block) ⇒ Object



104
105
106
107
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/expectations/expectation_target.rb', line 104

def not_to(matcher=nil, message=nil, &block)
  enforce_value_expectation(matcher)
  super
end

#to(matcher = nil, message = nil, &block) ⇒ Object



99
100
101
102
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/expectations/expectation_target.rb', line 99

def to(matcher=nil, message=nil, &block)
  enforce_value_expectation(matcher)
  super
end