module RSpec::Expectations::ExpectationTarget::InstanceMethods
def not_to(matcher=nil, message=nil, &block)
- See: RSpec::Matchers -
Returns:
-
(Boolean)
- false if the negative expectation succeeds (else raises)
Parameters:
-
message
(String, Proc
) -- optional message to display when the expectation fails -
(
Matcher
) --
def not_to(matcher=nil, message=nil, &block) prevent_operator_matchers(:not_to) unless matcher RSpec::Expectations::NegativeExpectationHandler.handle_matcher(target, matcher, message, &block) end
def prevent_operator_matchers(verb)
def prevent_operator_matchers(verb) raise ArgumentError, "The expect syntax does not support operator matchers, " \ "so you must pass a matcher to `##{verb}`." end
def to(matcher=nil, message=nil, &block)
- See: RSpec::Matchers -
Returns:
-
(Boolean)
- true if the expectation succeeds (else raises)
Parameters:
-
message
(String, Proc
) -- optional message to display when the expectation fails -
(
Matcher
) --
def to(matcher=nil, message=nil, &block) prevent_operator_matchers(:to) unless matcher RSpec::Expectations::PositiveExpectationHandler.handle_matcher(target, matcher, message, &block) end