10 use Catalyst::Script::Test;
11 use File::Temp qw/tempfile/;
14 is run_test('/'), "root index\n", 'correct content printed';
15 is run_test('/moose/get_attribute'), "42\n", 'Correct content printed for non root action';
22 my ($fh, $fn) = tempfile();
31 $i = Catalyst::Script::Test->new_with_options(application_name => 'TestApp');
35 open( $saved, '<&'. STDIN->fileno )
36 or croak("Can't dup stdin: $!");
37 open( STDOUT, '>&='. $fh->fileno )
38 or croak("Can't open stdout: $!");
43 or croak("Can't flush stdout: $!");
45 open( STDOUT, '>&'. fileno($saved) )
46 or croak("Can't restore stdout: $!");
49 my $data = do { my $fh; open($fh, '<', $fn) or die $!; local $/; <$fh>; };