# depreciation transition
requires 'Catalyst::DispatchType::Regex' => '5.90021';
-test_requires 'Test::Exception';
+test_requires 'Test::Fatal';
test_requires 'Test::More' => '0.88';
test_requires 'Data::Dump';
test_requires 'HTTP::Request::Common';
/;
}
-use Test::Exception;
-lives_ok {
+use Test::Fatal;
+is exception {
TestAppC3ErrorUseMoose->setup();
-} 'No C3 error';
+}, undef, 'No C3 error';
1;
use strict;
use warnings;
use Test::More;
-use Test::Exception;
use Class::MOP ();
use Moose::Util ();
use strict;
use warnings;
use Test::More;
-use Test::Exception;
+use Test::Fatal;
use Catalyst::Engine;
my $m = sub { Catalyst::Engine->_dump_error_page_element(@_) };
-lives_ok { $m->('Scalar' => ['foo' => 'bar']) };
-lives_ok { $m->('Array' => ['foo' => []]) };
-lives_ok { $m->('Hash' => ['foo' => {}]) };
+is exception { $m->('Scalar' => ['foo' => 'bar']) }, undef;
+is exception { $m->('Array' => ['foo' => []]) }, undef;
+is exception { $m->('Hash' => ['foo' => {}]) }, undef;
done_testing;
use FindBin qw/$Bin/;
use lib "$Bin/../lib";
use Test::More tests => 1;
-use Test::Exception;
use Carp ();
# Doing various silly things, like for example
use lib "$Bin/../lib";
use Test::More;
-use Test::Exception;
+use Test::Fatal;
use Catalyst::Script::CGI;
local @ARGV;
-lives_ok {
+is exception {
Catalyst::Script::CGI->new_with_options(application_name => 'TestAppToTestScripts')->run;
-} "new_with_options";
+}, undef, "new_with_options";
shift @TestAppToTestScripts::RUN_ARGS;
my $server = pop @TestAppToTestScripts::RUN_ARGS;
like ref($server), qr/^Plack::Handler/, 'Is a Plack::Handler';
use strict;
use warnings;
use Test::More;
-use Test::Exception;
+use Test::Fatal;
use FindBin qw/$Bin/;
use lib "$Bin/../lib";
{
local $TestCreateScript::help;
local @ARGV;
- lives_ok {
+ is exception {
TestCreateScript->new_with_options(application_name => 'TestAppToTestScripts', helper_class => 'TestHelperClass')->run;
- } "no argv";
+ }, undef, "no argv";
ok $TestCreateScript::help, 'Exited with usage info';
}
{
local @ARGV = 'foo';
local @TestHelperClass::ARGS;
local %TestHelperClass::p;
- lives_ok {
+ is exception {
TestCreateScript->new_with_options(application_name => 'TestAppToTestScripts', helper_class => 'TestHelperClass')->run;
- } "with argv";
+ }, undef, "with argv";
ok !$TestCreateScript::help, 'Did not exit with usage into';
is_deeply \@TestHelperClass::ARGS, ['TestAppToTestScripts', 'foo'], 'Args correct';
is_deeply \%TestHelperClass::p, { '.newfiles' => 1, mech => undef }, 'Params correct';
local @ARGV = 'foo';
local @TestHelperClass::ARGS;
local %TestHelperClass::p;
- lives_ok {
+ is exception {
TestCreateScript->new_with_options(application_name => 'TestAppToTestScripts', helper_class => 'TestHelperClass::False')->run;
- } "with argv";
+ }, undef, "with argv";
ok $TestCreateScript::help, 'Did exit with usage into as mk_component returned false';
is_deeply \@TestHelperClass::ARGS, ['TestAppToTestScripts', 'foo'], 'Args correct';
is_deeply \%TestHelperClass::p, { '.newfiles' => 1, mech => undef }, 'Params correct';
use lib "$Bin/../lib";
use Test::More;
-use Test::Exception;
+use Test::Fatal;
use Catalyst::Script::FastCGI;
local @ARGV = @$argstring;
local @TestAppToTestScripts::RUN_ARGS;
- lives_ok {
+ is exception {
TestFastCGIScript->new_with_options(application_name => 'TestAppToTestScripts')->run;
- } "new_with_options";
+ }, undef, "new_with_options";
# First element of RUN_ARGS will be the script name, which we don't care about
shift @TestAppToTestScripts::RUN_ARGS;
use strict;
use warnings;
use Test::More;
-use Test::Exception;
+use Test::Fatal;
use FindBin qw/$Bin/;
use lib "$Bin/../lib";
sub test {
local $TestHelpScript::help;
local @ARGV = (@_);
- lives_ok {
+ is exception {
TestHelpScript->new_with_options(application_name => 'TestAppToTestScripts')->run;
- } 'Lives';
+ }, undef, 'Lives';
ok $TestHelpScript::help, 'Got help';
}
use warnings;
use Test::More;
use FindBin qw/$Bin/;
-use Test::Exception;
+use Test::Fatal;
use lib "$Bin/../lib";
use_ok('Catalyst::ScriptRunner');
'Script existing only in Catalyst';
# +1 test for the params passed to new_with_options in t/lib/Catalyst/Script/Baz.pm
-throws_ok(sub {
+like exception {
Catalyst::ScriptRunner->run('ScriptTestApp', 'CompileTest');
-}, qr/Couldn't load class/);
+}, qr/Couldn't load class/;
done_testing;
use warnings;
use Test::More tests => 30;
-use Test::Exception;
use Catalyst ();
use lib "$Bin/../lib";
use Catalyst::Utils;
use HTTP::Request::Common;
-use Test::Exception;
+use Test::Fatal;
my $Class = 'Catalyst::Test';
my $App = 'TestApp';
ok( $c->stash, " Stash accessible" );
ok( $c->action, " Action object accessible" );
ok( $res->request, " Response has request object" );
- lives_and { is( $res->request->uri, $Url) }
+ is exception { is( $res->request->uri, $Url) }, undef,
" Request object has correct url";
} }
}
use_ok('Catalyst::Test', 'TestApp', 'foobar');
# Back compat test, ensure that request ignores anything which isn't a hash.
-lives_ok {
+is exception {
request(GET('/dummy'), 'foo');
-} 'scalar additional param to request method ignored';
-lives_ok {
+}, undef, 'scalar additional param to request method ignored';
+is exception {
request(GET('/dummy'), []);
-} 'array additional param to request method ignored';
+}, undef, 'array additional param to request method ignored';
my $res = request(GET('/'));
is $res->code, 200, 'Response code 200';
package TestApp::Controller::Other;
use Moose;
use Test::More tests => 1;
- use Test::Exception;
- lives_ok {
+ use Test::Fatal;
+ is exception {
extends 'TestApp::Controller::Base';
- };
+ }, undef;
}
use lib "$FindBin::Bin/../lib";
use Test::More tests => 1;
-use Test::Exception;
+use Test::Fatal;
use TestAppNonMooseController;
# Metaclass init order causes fail.
# f2391d17574eff81d911b97be15ea51080500003
# after which the evil kludge in core can die in a fire.
-lives_ok {
+is exception {
TestAppNonMooseController::ControllerBase->get_action_methods
-} 'Base class->get_action_methods ok when sub class initialized first';
+}, undef, 'Base class->get_action_methods ok when sub class initialized first';
use FindBin qw/$Bin/;
use lib "$Bin/lib";
use Test::More tests => 2;
-use Test::Exception;
+use Test::Fatal;
-lives_ok {
+is exception {
require TestAppClassExceptionSimpleTest;
-} 'Can load application';
+}, undef, 'Can load application';
-lives_ok {
+is exception {
Catalyst::Exception->throw
-} 'throw is properly stubbed out';
+}, undef, 'throw is properly stubbed out';
# See t/plugin_new_method_backcompat.t
package TestAppPluginWithConstructor;
use Test::More;
-use Test::Exception;
+use Test::Fatal;
use Catalyst qw/+TestPluginWithConstructor/;
use Moose;
extends qw/Catalyst/;
__PACKAGE__->setup;
our $MODIFIER_FIRED = 0;
-lives_ok {
+is exception {
before 'dispatch' => sub { $MODIFIER_FIRED = 1 }
-} 'Can apply method modifier';
+}, undef, 'Can apply method modifier';
no Moose;
our $IS_IMMUTABLE_YET = __PACKAGE__->meta->is_immutable;
# Also tests method modifiers and etc in MyApp.pm still work as expected.
use Test::More;
-use Test::Exception;
use Moose::Util qw/find_meta/;
use FindBin;
use lib "$FindBin::Bin/lib";
use lib "$Bin/lib";
use Test::More;
-use Test::Exception;
+use Test::Fatal;
use Plack::Test;
use TestApp;
use HTTP::Request::Common;
test_psgi $app, sub {
my $cb = shift;
- lives_ok {
+ is exception {
my $TIMEOUT_IN_SECONDS = 5;
local $SIG{ALRM} = sub { die "alarm\n" };
alarm($TIMEOUT_IN_SECONDS);
alarm(0);
1
- } q{app didn't die or timeout};
+ }, undef, q{app didn't die or timeout};
};
done_testing;
use lib "$Bin/lib";
use Test::More;
-use Test::Exception;
+use Test::Fatal;
use Catalyst::Script::Test;
use File::Temp qw/tempfile/;
{
local @ARGV = ($url);
my $i;
- lives_ok {
+ is exception {
$i = Catalyst::Script::Test->new_with_options(application_name => 'TestApp');
- } "new_with_options";
+ }, undef, "new_with_options";
ok $i;
my $saved;
open( $saved, '>&'. STDOUT->fileno )