Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Minimal yet very useful mocker for Perl
Perl
tag: v0.01

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib/Test
t
.gitignore
.perlcriticrc
.perltidyrc
Changes
MANIFEST
Makefile.PL
README
ignore.txt

README

Test-TinyMocker

    use Test::More;
    use Test::TinyMocker;

    mock 'Some::Module'
        => method 'some_method'
        => should {
            return $mocked_value;
        };

    # or 

    mock 'Some::Module::some_method'
        => should {
            return $mocked_value;
        };

    # Some::Module::some_method() will now always return $mocked_value;


This module was inspired by Gugod's blog, after the article published about
mocking in Ruby and Perl: http://gugod.org/2009/05/mocking.html

This module was first part of the test tools provided by Dancer in its own t
directory (previously named C<t::lib::EasyMocker>). A couple of developers asked
me if I could released this module as a real Test:: distribution on CPAN, so
here it is.


Something went wrong with that request. Please try again.