Module: RSpec::Clone::ExpectationTarget Private
- Defined in:
- lib/r_spec/clone/expectation_target.rb,
lib/r_spec/clone/expectation_target/base.rb,
lib/r_spec/clone/expectation_target/block.rb,
lib/r_spec/clone/expectation_target/value.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Wraps the target of an expectation.
Defined Under Namespace
Class Method Summary collapse
-
.call(undefined_value, value, block) ⇒ Block, Value
private
The wrapped target of an expectation.
Class Method Details
.call(undefined_value, value, block) ⇒ Block, Value
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 The wrapped target of an expectation.
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/r_spec/clone/expectation_target.rb', line 17 def self.call(undefined_value, value, block) if undefined_value.equal?(value) raise ::ArgumentError, "Pass either an argument or a block" unless block Block.new(block) else raise ::ArgumentError, "Can't pass both an argument and a block" if block Value.new(value) end end |