Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dex4er/perl-test-builder-mock-class
Test::Builder::Mock::Class - Simulating other classes for Test::Builder
https://github.com/dex4er/perl-test-builder-mock-class
Last synced: 11 days ago
JSON representation
Test::Builder::Mock::Class - Simulating other classes for Test::Builder
- Host: GitHub
- URL: https://github.com/dex4er/perl-test-builder-mock-class
- Owner: dex4er
- License: other
- Created: 2010-04-28T16:01:49.000Z (over 14 years ago)
- Default Branch: cpan
- Last Pushed: 2010-05-28T23:06:41.000Z (over 14 years ago)
- Last Synced: 2024-10-28T09:01:45.872Z (about 2 months ago)
- Language: Perl
- Homepage: http://search.cpan.org/dist/Test-Builder-Mock-Class/
- Size: 176 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
NAME
Test::Builder::Mock::Class - Simulating other classes for Test::BuilderSYNOPSIS
use Test::Builder::Mock::Class ':all';
use Test::More 'no_plan';# concrete mock class
mock_class 'Net::FTP' => 'Net::FTP::Mock';
my $mock_object1 = Net::FTP::Mock->new;
$mock_object1->mock_tally;# anonymous mocked class
my $metamock2 = mock_anon_class 'Net::FTP';
my $mock_object2 = $metamock2->new_object;
$mock_object2->mock_tally;# anonymous class with role applied
my $metamock3 = Test::Builder::Mock::Class->create_mock_anon_class(
class => 'Net::FTP',
roles => [ 'My::Handler::Role' ],
);
my $mock_object3 = $metamock3->new_object;
$mock_object3->mock_tally;DESCRIPTION
This module adds support for standard Test::Builder framework
(Test::Simple or Test::More) to Test::Mock::Class.Mock class can be used to create mock objects which can simulate the
behavior of complex, real (non-mock) objects and are therefore useful
when a real object is impractical or impossible to incorporate into a
unit test.See Test::Mock::Class for more detailed documentation.
BUGS
The API is not stable yet and can be changed in future.AUTHOR
Piotr RoszatyckiLICENSE
Based on SimpleTest, an open source unit test framework for the PHP
programming language, created by Marcus Baker, Jason Sweat, Travis
Swicegood, Perrick Penet and Edward Z. Yang.Copyright (c) 2009, 2010 Piotr Roszatycki .
This program is free software; you can redistribute it and/or modify it
under GNU Lesser General Public License.