Import of FLORA/CatalystX-REPL-0.01 from CPAN.
gitpan-cpan-distribution: CatalystX-REPL gitpan-cpan-version: 0.01 gitpan-cpan-path: FLORA/CatalystX-REPL-0.01.tar.gz gitpan-cpan-author: FLORA gitpan-cpan-maturity: released
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 5;
|
||||
use Test::Expect;
|
||||
|
||||
expect_run(
|
||||
command => "${^X} t/request.pl /foo/bar",
|
||||
prompt => '$ ',
|
||||
quit => 'exit'
|
||||
);
|
||||
|
||||
expect_send('1 + 1');
|
||||
expect_like(qr/\b2\b/, 'in the REPL');
|
||||
|
||||
expect_send(':t');
|
||||
expect_like(qr/\bTestApp::Controller::Foo::bar\b/, 'exception in controller action');
|
||||
@@ -0,0 +1,12 @@
|
||||
package TestApp;
|
||||
our $VERSION = '0.01';
|
||||
|
||||
|
||||
use Moose;
|
||||
|
||||
extends 'Catalyst';
|
||||
with 'CatalystX::REPL';
|
||||
|
||||
__PACKAGE__->setup;
|
||||
|
||||
1;
|
||||
@@ -0,0 +1,13 @@
|
||||
package TestApp::Controller::Foo;
|
||||
our $VERSION = '0.01';
|
||||
|
||||
|
||||
use Moose;
|
||||
|
||||
BEGIN { extends 'Catalyst::Controller'; }
|
||||
|
||||
sub bar : Local {
|
||||
die 42;
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -0,0 +1,13 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
BEGIN { @ENV{qw/CATALYST_DEBUG CATALYST_REPL/} = (1, 1); }
|
||||
|
||||
use FindBin;
|
||||
use lib "$FindBin::Bin/lib";
|
||||
|
||||
use Catalyst::Test 'TestApp';
|
||||
|
||||
$Carp::REPL::noprofile = 1;
|
||||
|
||||
request($ARGV[0]);
|
||||
Reference in New Issue
Block a user