Browse files

C::M::Fastがないときとlocalにmemcachedがないときはスキップ

  • Loading branch information...
1 parent 91d137b commit 96f8231ad47680f1b4fb3688d8b13da92f15486f @nekokak committed Nov 10, 2010
Showing with 12 additions and 4 deletions.
  1. +12 −4 t/030_plugin/session/store/memcached.t
View
16 t/030_plugin/session/store/memcached.t
@@ -3,12 +3,20 @@ use Test::More;
use Kamui::Web::Context;
use Mock::Container;
use Mock::Web::Handler;
-use Cache::Memcached::Fast;
BEGIN {
- my $memd = Cache::Memcached::Fast->new({servers => ['127.0.0.1:11211']});
- my $version = $memd->server_versions;
- plan skip_all => 'can not access local memcached' unless scalar(keys %$version);
+ eval "use Cache::Memcached::Fast";
+ plan skip_all => 'needs Cache::Memcached::Fast for testing' if $@;
+
+ my $memd = Cache::Memcached::Fast->new(
+ {
+ servers => [qw/127.0.0.1:11211/],
+ }
+ );
+
+ unless (keys %{$memd->server_versions}) {
+ plan skip_all => 'memcached server missing. skip testing';
+ }
};
my $plugins = [qw/Session/];

0 comments on commit 96f8231

Please sign in to comment.