Class: Fix::It

Inherits:
Object
  • Object
show all
Defined in:
lib/fix/it.rb

Overview

Wraps the target of an expectation.

Instance Method Summary collapse

Instance Method Details

#expect(object) ⇒ Expect

Create a new expection target given an object.

Parameters:

  • object (#object_id)

    An object to test.

Returns:

  • (Expect)

    An expect instance.



14
15
16
# File 'lib/fix/it.rb', line 14

def expect(object)
  Expect.new(object, *challenges)
end

#expect_block(&block) ⇒ Expect

Create a new expection target given a block.

Parameters:

  • block (Proc)

    A code to test.

Returns:

  • (Expect)

    An expect instance.



23
24
25
# File 'lib/fix/it.rb', line 23

def expect_block(&block)
  Expect.new(block, *([block_challenge] + challenges))
end

#is_expectedExpect

Create a new expection target given the subject.

Returns:

  • (Expect)

    An expect instance.



32
33
34
# File 'lib/fix/it.rb', line 32

def is_expected
  Expect.new(subject, *challenges)
end