11 use Catalyst::Script::Test;
12 use File::Temp qw/tempfile/;
15 is run_test('/'), "root index\n", 'correct content printed';
16 is run_test('/moose/get_attribute'), "42\n", 'Correct content printed for non root action';
23 my ($fh, $fn) = tempfile();
32 $i = Catalyst::Script::Test->new_with_options(application_name => 'TestApp');
36 open( $saved, '>&'. STDOUT->fileno )
37 or croak("Can't dup stdout: $!");
38 open( STDOUT, '>&='. $fh->fileno )
39 or croak("Can't open stdout: $!");
44 or croak("Can't flush stdout: $!");
46 open( STDOUT, '>&'. fileno($saved) )
47 or croak("Can't restore stdout: $!");
50 my $data = do { my $fh; open($fh, '<', $fn) or die $!; local $/; <$fh>; };