File: unit_core_scriptrunner.t

package info (click to toggle)
libcatalyst-perl 5.80025-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,104 kB
  • ctags: 1,183
  • sloc: perl: 15,616; makefile: 7
file content (24 lines) | stat: -rw-r--r-- 960 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use strict;
use warnings;
use Test::More;
use FindBin qw/$Bin/;
use lib "$Bin/../lib";

use_ok('Catalyst::ScriptRunner');

is Catalyst::ScriptRunner->run('ScriptTestApp', 'Foo'), 'ScriptTestApp::Script::Foo',
    'Script existing only in app';
is Catalyst::ScriptRunner->run('ScriptTestApp', 'Bar'), 'ScriptTestApp::Script::Bar',
    'Script existing in both app and Catalyst - prefers app';
is Catalyst::ScriptRunner->run('ScriptTestApp', 'Baz'), 'Catalyst::Script::Baz',
    'Script existing only in Catalyst';
# +1 test for the params passed to new_with_options in t/lib/Catalyst/Script/Baz.pm
{
    my $warnings = '';
    local $SIG{__WARN__} = sub { $warnings .= shift };
    is 'Catalyst::Script::CompileTest', Catalyst::ScriptRunner->run('ScriptTestApp', 'CompileTest');
    like $warnings, qr/Does not compile/;
    like $warnings, qr/Could not load ScriptTestApp::Script::CompileTest - falling back to Catalyst::Script::CompileTest/;
}

done_testing;