Method: BasicObject#should_not

Defined in:
lib/rspec/expectations/syntax.rb

#should_not(matcher, message) ⇒ Boolean

Note:

This is only available when you have enabled the :should syntax.

Passes if matcher returns false. Available on every Object.

Examples:

actual.should_not eq expected

Parameters:

  • matcher (Matcher)
  • message (String)

    optional message to display when the expectation fails

Returns:

  • (Boolean)

    false if the negative expectation succeeds (else raises)

See Also:



# File 'lib/rspec/expectations/syntax.rb', line 121