Class: RSpec::Maybes::BlockMaybeTarget

Inherits:
MaybeTarget show all
Defined in:
lib/rspec/maybes/maybe_target.rb

Overview

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

Constant Summary

Constants inherited from MaybeTarget

MaybeTarget::UndefinedValue

Instance Method Summary collapse

Methods inherited from MaybeTarget

for, #initialize

Constructor Details

This class inherits a constructor from RSpec::Maybes::MaybeTarget

Instance Method Details

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


86
87
88
89
# File 'lib/rspec/maybes/maybe_target.rb', line 86

def will(matcher, message = nil, &block)
  enforce_block_maybe(matcher)
  super
end

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


91
92
93
94
# File 'lib/rspec/maybes/maybe_target.rb', line 91

def will_not(matcher, message = nil, &block)
  enforce_block_maybe(matcher)
  super
end