Mock::Quick::Object(3pm)

Mock::Quick::Object3pm

Object mocking for mock::quick

Usage

    use Mock::Quick::Object;
    use Mock::Quick::Method;
    my $obj = Mock::Quick::Object->new(
        foo => 'bar',            # define attribute
        do_it => qmeth { ... },  # define method
        ...
    );
    is( $obj->foo, 'bar' );
    $obj->foo( 'baz' );
    is( $obj->foo, 'baz' );
    $obj->do_it();
    # define the new attribute automatically
    $obj->bar( 'xxx' );
    # define a new method on the fly
    $obj->baz( Mock::Quick::Method->new( sub { ... });
    # remove an attribute or method
    $obj->baz( \$Mock::Quick::Util::CLEAR );

Overview

Provides object mocking. See Mock::Quick for a better interface.

Releases

6 releases since Debian 8 (Jessie); the text changed 2 times.

  1. 8
  2. 9–11
  3. 12–13

Authors

Chad Granum [email protected]

From libmock-quick-perl 1.111-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.