Module: Expect

Defined in:
lib/expect.rb,
lib/expect/expectation_target.rb

Overview

Namespace for the Expect library.

Examples:

Expect 42 to be equal to 42

Expect.this { 42 }.to Equal: 42 # => true

Defined Under Namespace

Classes: ExpectationTarget

Class Method Summary collapse

Class Method Details

.this(&input) ⇒ ExpectationTarget

Expectations are built with this method.

Examples:

Identity expectation

this { 42 }.to Equal: 42 # => true

Parameters:

  • input (Proc)

    the code to test.

Returns:



20
21
22
# File 'lib/expect.rb', line 20

def self.this(&input)
  ExpectationTarget.new(&input)
end