From f5acb0e9b34ef7ca5aa992fb1406a709ddade3a0 Mon Sep 17 00:00:00 2001 From: franck cuny Date: Fri, 8 Oct 2010 15:39:16 +0200 Subject: update tests --- t/00-load.t | 3 +-- t/02-app.t | 20 ++++++++++++++++++++ t/index.tx | 3 +++ 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 t/02-app.t create mode 100644 t/index.tx diff --git a/t/00-load.t b/t/00-load.t index da6530d..d4ef20b 100644 --- a/t/00-load.t +++ b/t/00-load.t @@ -3,6 +3,5 @@ use warnings; use Test::More tests => 1; BEGIN { - use_ok( 'Dancer::Template::Xslate' ) || print "Bail out! -"; + use_ok( 'Dancer::Template::Xslate' ) || print "Bail out!"; } diff --git a/t/02-app.t b/t/02-app.t new file mode 100644 index 0000000..73e738c --- /dev/null +++ b/t/02-app.t @@ -0,0 +1,20 @@ +use strict; +use warnings; +use Test::More import => ["!pass"]; + +use Dancer ':syntax'; +use Dancer::Test; + +plan tests => 3; + +setting template => 'xslate'; +setting views => 't'; + +ok( + get '/' => sub { + template 'index', { loop => [1..2] }; + } +); + +route_exists [ GET => '/' ]; +response_content_like( [ GET => '/' ], qr/1
\n2/ ); diff --git a/t/index.tx b/t/index.tx new file mode 100644 index 0000000..8ecc8e1 --- /dev/null +++ b/t/index.tx @@ -0,0 +1,3 @@ +:for $loop -> $i { +<: $i :>
+:} -- cgit 1.4.1