NAME

Test::Mimic::Generator - Perl module for generating mock perl packages from data recorded by Test::Mimic::Recorder.

SYNOPSIS

use Test::Mimic::Generator;

my $generator = Test::Mimic::Generator->new();
$generator->load('.test_mimic_recorder_data');
$generator->write('.test_mimic_data');

DESCRIPTION

Test::Mimic::Generator->new()

Constructs and returns a new generator object.

$generator->load($read_directory)

Accepts the name of a directory to load information from. Test::Mimic::Recorder must have written to this directory. Can be called multiple times. Only the information from the last call will be used. Later in development we should be able to merge multiple recordings.

$generator->write($write_directory)

Accepts the name of a directory to store the generated .pm files and other information in. This directory need not exist. The .pm files will be stored in "$write_directory/lib". Additional history information will be recorded in "$write_directory/history_for_playback.rec".

NOTE

It should be mentioned that the generated .pm files require that Test::Mimic::Library be in a certain state. Specifically, Test::Mimic::Library::load_records("$write_directory/history_for_playback.rec") should have been called. Typically this is handled by the controller, Test::Mimic, but if you are using the files independently you must do this yourself.

EXPORT

Nothing available for export.

SEE ALSO

Other members of the Test::Mimic suite: Test::Mimic Test::Mimic::Recorder Test::Mimic::Library

The latest source for the Test::Mimic suite is available at:

git://github.com/brendanr/Test--Mimic.git

AUTHOR

Brendan Roof, <brendanroof@gmail.com>

COPYRIGHT AND LICENSE

Copyright (C) 2009 by Brendan Roof.

Made possible by a generous contribution from WhitePages, Inc.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.