summary refs log tree commit diff
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2009-12-14 11:56:47 +0100
committerfranck cuny <franck@lumberjaph.net>2009-12-14 11:56:47 +0100
commitd5356098ad38a6f1f0195ead2af44c66bd1a1168 (patch)
treec5c1a3ea168090e3617289a8b17bf1f0ffb8cd0c
parentadd walk method (diff)
downloadanyevent-riak-d5356098ad38a6f1f0195ead2af44c66bd1a1168.tar.gz
run tests only if a server is available
-rw-r--r--t/basic.t16
1 files changed, 10 insertions, 6 deletions
diff --git a/t/basic.t b/t/basic.t
index ecb1d05..cf0e6a2 100644
--- a/t/basic.t
+++ b/t/basic.t
@@ -5,12 +5,16 @@ use JSON::XS;
 use Test::Exception;
 use AnyEvent::Riak;
 
-my $jiak = AnyEvent::Riak->new(
-    host => 'http://127.0.0.1:8098',
-
-    #host => 'http://192.168.0.11:8098',
-    path => 'jiak'
-);
+my ($host, $path);
+BEGIN {
+    my $riak_test = $ENV{RIAK_TEST_SERVER};
+    ( $host, $path ) = split ";", $riak_test if $riak_test;
+    plan skip_all =>
+        'set $ENV{RIAK_TEST_SERVER} like this http://127.0.0.1:8098;jiak if you want to run the tests'
+        unless ( $host && $path );
+}
+
+my $jiak = AnyEvent::Riak->new( host => $host, path => $path );
 
 ok my $buckets = $jiak->list_bucket('bar')->recv, "... fetch bucket list";
 is scalar @{ $buckets->{keys} }, '0', '... no keys';