Class: Fix::It

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

Overview

Wraps the target of a Fix expectation.

Instance Method Summary collapse

Instance Method Details

#expect(object = nil, &block) ⇒ Expect

Create a new expection target given an object.

Parameters:

  • object (#object_id) (defaults to: nil)

    An object to test.

Returns:

  • (Expect)

    An expect instance.



28
29
30
31
32
33
34
# File 'lib/fix/it.rb', line 28

def expect(object = nil, &block)
  if block
    ::Fix::Expect.new(block)
  else
    ::Fix::Expect.new(::Defi.send(:itself).to(object))
  end
end

#is_expectedExpect

Create a new expection target given the subject.

rubocop:disable Naming/PredicateName

Returns:

  • (Expect)

    An expect instance.



41
42
43
# File 'lib/fix/it.rb', line 41

def is_expected
  ::Fix::Expect.new(callable)
end