Amon2-CLI

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN

use lib qw/lib/;

use Module::Build::Compat;

Module::Build::Compat->run_build_pl(args => \@ARGV);
Module::Build::Compat->write_makefile(build_class => 'Module::Build');

t/01_basic.t  view on Meta::CPAN

use strict;
use warnings;
use FindBin;
use File::Spec;
use lib File::Spec->catdir($FindBin::Bin, 'lib');

use Test::More;
use Test::Output;

use Amon2::CLI 'MyApp';

{
    Test::Output::stdout_is {
        MyApp->bootstrap->run(sub{
            my ($c) = @_;

t/02_custom_myapp_cli_class.t  view on Meta::CPAN

use strict;
use warnings;
use FindBin;
use File::Spec;
use lib File::Spec->catdir($FindBin::Bin, 'lib');

use Test::More;
use Test::Output;

use Amon2::CLI 'MyApp', 'MyApp::Cmd';

{
    Test::Output::stdout_is {
        MyApp->bootstrap->run('Foo'); # run MyApp::Cmd::Foo::main
    } 'cmd!', 'MyApp::Cmd::Foo';

t/03_cli_opt.t  view on Meta::CPAN

use strict;
use warnings;
use FindBin;
use File::Spec;
use lib File::Spec->catdir($FindBin::Bin, 'lib');

use Test::More;
use Test::Output;

use Amon2::CLI 'MyApp';

{
    local @ARGV = ('--option' => 'bar!');
    Test::Output::stdout_is {
        MyApp->bootstrap->run('Bar');

t/04_show_usage.t  view on Meta::CPAN

use strict;
use warnings;
use FindBin;
use File::Spec;
use lib File::Spec->catdir($FindBin::Bin, 'lib');

use Test::More;
use Test::Output;

use Amon2::CLI 'MyApp';

{
    stdout_like {
        MyApp->bootstrap->show_usage(-exitval => 'NOEXIT');
    } qr/print "usage";/, "show usage";

t/05_croak.t  view on Meta::CPAN

use strict;
use warnings;
use FindBin;
use File::Spec;
use lib File::Spec->catdir($FindBin::Bin, 'lib');

use Test::More;
use Test::Output;

use Amon2::CLI 'MyApp';

{
    Test::Output::stdout_like {
        eval {
            MyApp->bootstrap->run(sub{

t/06_hook.t  view on Meta::CPAN

use strict;
use warnings;
use FindBin;
use File::Spec;
use lib File::Spec->catdir($FindBin::Bin, 'lib');

use Test::More;
use Test::Output;

use MyHookApp;

{
    Test::Output::stdout_is {
        MyHookApp->bootstrap->run(sub{
            my ($c) = @_;



( run in 0.421 second using v1.01-cache-2.11-cpan-87723dcf8b7 )