]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Maypole/CLI.pm
Merged Apache2::MVC into Apache::MVC, deprecated $r->{query}
[maypole.git] / lib / Maypole / CLI.pm
index b40dc0f1d1b2f9db5a68878c7c6ec4538cddc71e..b2c6e911d545885147fff1e872ad3f1837482d21 100644 (file)
@@ -1,6 +1,7 @@
 package Maypole::CLI;
 use UNIVERSAL::require;
 use URI; use URI::QueryParam;
+use Maypole::Constants;
 
 use strict;
 use warnings;
@@ -31,7 +32,7 @@ sub send_output { $buffer = shift->{output} }
 
 # Do it!
 CHECK { if ((caller(0))[1] eq "-e") { 
-            $package->handler() and print $buffer; 
+            $package->handler() == OK and print $buffer; 
        } }
 
 1;
@@ -83,16 +84,17 @@ For instance, a test script could look like this:
 
     use Test::More tests => 5;
     use Maypole::CLI qw(BeerDB);
+    use Maypole::Constants;
     $ENV{MAYPOLE_TEMPLATES} = "t/templates";
 
     # Hack because isa_ok only supports object isa not class isa
     isa_ok( (bless {},"BeerDB") , "Maypole");
 
     @ARGV = ("http://localhost/beerdb/");
-    is(BeerDB->handler, 200, "OK");
+    is(BeerDB->handler, OK, "OK");
     like($Maypole::CLI::buffer, qr/frontpage/, "Got the front page");
 
     @ARGV = ("http://localhost/beerdb/beer/list");
-    is(BeerDB->handler, 200, "OK");
+    is(BeerDB->handler, OK, "OK");
     like($Maypole::CLI::buffer, qr/Organic Best/, "Found a beer in the list");