File: formatter_redirect.t

package info (click to toggle)
libmojomojo-perl 1.01%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 4,272 kB
  • ctags: 879
  • sloc: perl: 14,055; sh: 145; xml: 120; ruby: 6; makefile: 2
file content (22 lines) | stat: -rwxr-xr-x 707 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More tests => 4;
use MojoMojo::Formatter::Redirect;
use lib 't/lib';
use FakeCatalystObject;


my ($content, $exist, $new);
my $fake_c = FakeCatalystObject->new;

$content = "{{redirect /foo}}";
MojoMojo::Formatter::Redirect->format_content(\$content, $fake_c, undef);
is($fake_c->redirect, '/foo' ,"Redirect is set");
is($content,"{{redirect /foo}}","Content is unchanged");

$fake_c = FakeCatalystObject->new;
$content = "{{redirect /foo-bar-baz}}";
MojoMojo::Formatter::Redirect->format_content(\$content, $fake_c, undef);
is($fake_c->redirect, '/foo-bar-baz', "URL charset test");
is($content,"{{redirect /foo-bar-baz}}", "Content is unchanged");