Class NotAMock::Stub
In: lib/not_a_mock/stub.rb
Parent: Object

Instances returned by Object.stub_instance are NotAMock::Stub objects. These do their best to masquerade as the real thing.

Methods

class   inspect   instance_of?   is_a?   kind_of?  

Public Instance methods

Returns the class of the stubbed object.

[Source]

    # File lib/not_a_mock/stub.rb, line 35
35:     def class
36:       @stubbed_class
37:     end

Returns "Stub StubbedClass".

[Source]

    # File lib/not_a_mock/stub.rb, line 18
18:     def inspect
19:       "Stub #{@stubbed_class.to_s}"
20:     end

Returns true if the class of the stubbed object is klass.

[Source]

    # File lib/not_a_mock/stub.rb, line 30
30:     def instance_of?(klass)
31:       @stubbed_class == klass
32:     end

Returns true if the class of the stubbed object or one of its superclasses is klass.

[Source]

    # File lib/not_a_mock/stub.rb, line 23
23:     def is_a?(klass)
24:       @stubbed_class.ancestors.include?(klass)
25:     end
kind_of?(klass)

Alias for is_a?

[Validate]