Class RSpec::Expectations::ExpectationTarget
In: lib/rspec/expectations/expectation_target.rb
Parent: Object

Wraps the target of an expectation. @example

  expect(something) # => ExpectationTarget wrapping something

  # used with `to`
  expect(actual).to eq(3)

  # with `to_not`
  expect(actual).to_not eq(3)

Methods

External Aliases

deprecated_should_enabled -> deprecated_should_enabled?

Attributes

deprecated_should_enabled  [RW] 

Public Class methods

@api private

Public Instance methods

not_to(matcher=nil, message=nil, &block)

Alias for to_not

Runs the given expectation, passing if `matcher` returns true. @example

  expect(value).to eq(5)
  expect { perform }.to raise_error

@param [Matcher]

  matcher

@param [String] message optional message to display when the expectation fails @return [Boolean] true if the expectation succeeds (else raises) @see RSpec::Matchers

Runs the given expectation, passing if `matcher` returns false. @example

  expect(value).to_not eq(5)
  expect(value).not_to eq(5)

@param [Matcher]

  matcher

@param [String] message optional message to display when the expectation fails @return [Boolean] false if the negative expectation succeeds (else raises) @see RSpec::Matchers

[Validate]