Author: ianjoyce
Date: Wed Aug 17 08:23:23 2005
New Revision: 205
Modified:
mod_parrot/trunk/t/99mod_pugs.t
Log:
cleaned up test (from [email protected])
Modified: mod_parrot/trunk/t/99mod_pugs.t
==============================================================================
--- mod_parrot/trunk/t/99mod_pugs.t (original)
+++ mod_parrot/trunk/t/99mod_pugs.t Wed Aug 17 08:23:23 2005
@@ -1,41 +1,44 @@
# $Id$
-use Apache::Test qw(:withtestmore);
+use Apache::Test qw(-withtestmore);
use Apache::TestRequest;
-use Apache::TestUtil qw(t_cmp);
-use Test::More;
-my $PUGS_REVISION = 4271;
+plan tests => 1, need_lwp && \&need_pugs;
-# can we run pugs?
-my $reason;
-
-# TEMPORARY -- SKIP UNTIL PUGS SUPPORTS OO w/ NEW CALLING CONVENTIONS
-$reason = "missing proper OO support";
-goto PLAN;
-
-no warnings;
-if (open(PUGS, "pugs -V:pugs_revision|")) {
- # do we have a compatible version?
- my $vstring = <PUGS>;
- close(PUGS);
- if ($vstring =~ /pugs_revision: (\d+)/) {
- if ($1 < $PUGS_REVISION) {
- $reason = "pugs revision ($1) earlier than required ($PUGS_REVISION)";
- }
- }
-}
-else {
- $reason = "pugs not installed";
-}
-
-PLAN:
-plan tests => 1, (need_lwp);
-
-SKIP: {
- skip $reason, 1 if $reason;
+{
my $res = GET '/parrot-test/pugs/handler';
my $content;
chomp($content = $res->content);
is($content, 'Testing 123', "mod_pugs handler");
}
+
+
+sub need_pugs {
+
+ Test::More::diag('inside!!!');
+ my $reason;
+
+ # TEMPORARY -- SKIP UNTIL PUGS SUPPORTS OO w/ NEW CALLING CONVENTIONS
+ return skip_reason("missing proper OO support");
+
+ my $PUGS_REVISION = 4271;
+
+ no warnings;
+ if (open(PUGS, "pugs -V:pugs_revision|")) {
+ # do we have a compatible version?
+ my $vstring = <PUGS>;
+ close(PUGS);
+ if ($vstring =~ /pugs_revision: (\d+)/) {
+ if ($1 < $PUGS_REVISION) {
+ $reason = "pugs revision ($1) earlier than required ($PUGS_REVISION)";
+ }
+ }
+ }
+ else {
+ $reason = "pugs not installed";
+ }
+
+ return skip_reason($reason) if $reason;
+
+ return 1;
+}
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.