File: Cron.pm

package info (click to toggle)
libcatalyst-plugin-scheduler-perl 0.10-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 236 kB
  • sloc: perl: 1,831; makefile: 4
file content (26 lines) | stat: -rw-r--r-- 543 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package TestApp::Controller::Cron;

use strict;
use warnings;
use base 'Catalyst::Controller';
use IO::File;

sub every_minute : Private {
    my ( $self, $c ) = @_;
    
    # write out a file so the test knows we did something
    my $fh = IO::File->new( $c->path_to( 'every_minute.log' ), 'w' )
        or die "Unable to write log file: $!";
    close $fh;
    
    # this tests that events cannot change the output
    $c->res->output( 'every_minute' );
}

sub test_errors : Private {
    my ( $self, $c ) = @_;
    
    die 'oops';
}

1;