root/veekun/trunk/lib/Vee/Controller/Test.pm

Revision 112, 1.2 KB (checked in by eevee, 3 years ago)

Added an auto-crash page.
Styled flagrant error page.

Line 
1package Vee::Controller::Test;
2
3use strict;
4use warnings;
5use base 'Catalyst::Controller';
6
7use Data::Dumper;
8
9=head1 NAME
10
11Vee::Controller::Test - Test Controller
12
13=head1 SYNOPSIS
14
15See L<Vee>
16
17=head1 DESCRIPTION
18
19I use this controller for random tests of snippets of code, and for convenience
20I am providing a nearly-empty version of it to everyone else.  It is not used
21by any other veekun code or required for anything.
22
23Please do not commit this file with random tests in it; it is meant to be used
24as your own personal sandbox.  If you want to write I<actual> tests, feel free
25to load up the F<t/> directory with a few dozen.
26
27=head1 METHODS
28
29=cut
30
31=head2 test
32
33Prints a blank page with success/error/info messages at the top.
34
35=cut
36
37sub test : Path {
38    my ($self, $c) = @_;
39    my $s = $c->stash;
40
41    $s->{success_msg} = "Success message";
42    $s->{error_msg} = "Error message";
43    $s->{info_msg} = "Info message";
44    $s->{template} = 'blank.tt';
45}
46
47=head2 crash
48
49Deliberately crashes.
50
51=cut
52
53sub crash : Local {
54    my ($self, $c) = @_;
55
56    my $crash = 1;
57    $crash /= 0;
58}
59
60=head1 AUTHOR
61
62A clever guy
63
64=head1 LICENSE
65
66This library is free software, you can redistribute it and/or modify
67it under the same terms as Perl itself.
68
69=cut
70
711;
Note: See TracBrowser for help on using the browser.