井関 恵太 > Test-EasyMock-0.09 > Test::EasyMock::Class

Download:
Test-EasyMock-0.09.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Source   Latest Release: Test-EasyMock-0.10

NAME ^

Test::EasyMock::Class - support class method mocking.

SYNOPSIS ^

    use Test::EasyMock qw(:all);
    use Test::EasyMock::Class qw(create_class_mock);
    
    my $mock = create_class_mock('Foo::Bar');
    expect($mock->foo(1))->and_scalar_return('a');
    replay($mock);
    Foo::Bar->foo(1); # return 'a'
    Foo::Bar->foo(2); # Unexpected method call.(A test is failed)
    verify($mock); # verify all expectations is invoked.

FUNCTIONS ^

create_class_mock($class)

Creates a mock object for class.

syntax highlighting: