Skip to content

xsawyerx/Test-TinyMocker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Minimal yet very useful mocker for Perl

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Perl 100.0%