[Catalyst-commits] r11107 - in Catalyst-Plugin-Browser/trunk/t: .
lib lib/TestApp lib/TestApp/Controller
rafl at dev.catalyst.perl.org
rafl at dev.catalyst.perl.org
Mon Aug 10 22:33:01 GMT 2009
Author: rafl
Date: 2009-08-10 22:32:59 +0000 (Mon, 10 Aug 2009)
New Revision: 11107
Added:
Catalyst-Plugin-Browser/trunk/t/basic.t
Catalyst-Plugin-Browser/trunk/t/lib/
Catalyst-Plugin-Browser/trunk/t/lib/TestApp.pm
Catalyst-Plugin-Browser/trunk/t/lib/TestApp/
Catalyst-Plugin-Browser/trunk/t/lib/TestApp/Controller/
Catalyst-Plugin-Browser/trunk/t/lib/TestApp/Controller/Root.pm
Log:
Add actual tests.
Added: Catalyst-Plugin-Browser/trunk/t/basic.t
===================================================================
--- Catalyst-Plugin-Browser/trunk/t/basic.t (rev 0)
+++ Catalyst-Plugin-Browser/trunk/t/basic.t 2009-08-10 22:32:59 UTC (rev 11107)
@@ -0,0 +1,13 @@
+use strict;
+use warnings;
+use Test::More;
+
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
+use Catalyst::Test 'TestApp';
+
+ok(get('/'), 'getting /');
+isa_ok($::browser, 'HTTP::BrowserDetect');
+
+done_testing;
Added: Catalyst-Plugin-Browser/trunk/t/lib/TestApp/Controller/Root.pm
===================================================================
--- Catalyst-Plugin-Browser/trunk/t/lib/TestApp/Controller/Root.pm (rev 0)
+++ Catalyst-Plugin-Browser/trunk/t/lib/TestApp/Controller/Root.pm 2009-08-10 22:32:59 UTC (rev 11107)
@@ -0,0 +1,16 @@
+package TestApp::Controller::Root;
+
+use Moose;
+use namespace::autoclean;
+
+BEGIN { extends 'Catalyst::Controller' }
+
+__PACKAGE__->config(namespace => '');
+
+sub index : Path Args(0) {
+ my ($self, $ctx) = @_;
+ $::browser = $ctx->request->browser;
+ $ctx->response->body('foo');
+}
+
+1;
Added: Catalyst-Plugin-Browser/trunk/t/lib/TestApp.pm
===================================================================
--- Catalyst-Plugin-Browser/trunk/t/lib/TestApp.pm (rev 0)
+++ Catalyst-Plugin-Browser/trunk/t/lib/TestApp.pm 2009-08-10 22:32:59 UTC (rev 11107)
@@ -0,0 +1,13 @@
+package TestApp;
+
+use Moose;
+use CatalystX::RoleApplicator;
+use namespace::autoclean;
+
+extends 'Catalyst';
+
+__PACKAGE__->setup(qw/
+ Browser
+/);
+
+1;
More information about the Catalyst-commits
mailing list