Class: RSpec::Expectations::BlockExpectationTarget

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, message = nil, &block) ⇒ Object Also known as: to_not



142
143
144
145
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/expectations/expectation_target.rb', line 142

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

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



137
138
139
140
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/expectations/expectation_target.rb', line 137

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