I've just uploaded the first version of these developer tools. The
idea is to make it easy to test plugins and other components of the
Maypole stack, much of which is rather sparsely tested (several of my
own modules in particular).
It also provides a mechanism for installing templates, rather than
just leaving them in the build directory.
Comments and suggestions for more tools are welcome.
Cheers,
d.
=head1 NAME
Devel::Maypole - support utilities for developing the Maypole stack
=head1 SYNOPSIS
# In a test script:
use Test::More tests => 42;
use Devel::Maypole qw/:test/;
my ( $database, $application );
BEGIN {
$ENV{MAYPOLE_CONFIG} = 'config/beerdb.simple.yaml';
$ENV{MAYPOLE_TEMPLATES} = 't/templates';
$database = database( ddl => 'sql/ddl/beerdb.simple.sql',
data => 'sql/data/beerdb.simple.sql',
);
$application = application( plugins => [ qw( Config::YAML
AutoUntaint Relationship ) ],
);
}
use Test::WWW::Mechanize::Maypole $application, $database;
# ----- BEGIN TESTING -----
# frontpage
{
my $mech = Test::WWW::Mechanize::Maypole->new;
$mech->get_ok("http://localhost/beerdb/");
$mech->content_contains( 'This is the frontpage' );
is($mech->ct, "text/html");
is($mech->status, 200);
}
# --------------------------------------
# In an installation script:
use Maypole::Devel qw/:install/;
# optionally suppress interactive questions:
# $ENV{MAYPOLE_TEMPLATES_INSTALL_PREFIX} = '/usr/local/maypole';
install_templates( 'Maypole::Plugin::Foo',
'distribution-templates-dir/set1', 'set1' );
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Maypole-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maypole-users