Test::Fixture::KyotoTycoon - load fixture data to kyototycoon
0.13
# in your t/fixture.yaml --- - key: foo value: bar - key: array value: - 1 - 2 - 3 - 4 - 5 - key: hash value: apple: red banana: yellow - namespace: "app:" key: nirvana value: smells like teen split - key: xt value: bar xt: 3 # in your t/*.t use Test::Fixture::KyotoTycoon; ## $kt is Cache::KyotoTycoon instance my $data = construct_fixture kt => $kt, fixture => "t/fixture.yaml";
Test::Fixture::KyotoTycoon is fixture data loader for Cache::KyotoTycoon.
load to ktserver
Example:
use Cache::KyotoTycoon; use Test::Fixture::KyotoTycoon; # basic sample my $kt = Cache::KyotoTycoon->new(host = "127.0.0.1"); my $fixture = "/path/to/fixture.yaml"; my $data = construct_fixture kt => $kt, fixture => $fixture;
Options:
kt Cache::KyotoTycoon instance fixture fixture yaml path or ARRAY reference serializer custom serializer(optional. default Storable::nfreeze)
Custom Serializer Example(using Data::MessagePack)
use Cache::KyotoTycoon; use Test::Fixture::KyotoTycoon; use Data::MessagePack; my $kt = Cache::KyotoTycoon->new(host = "127.0.0.1"); my $fixture = "/path/to/fixture.yaml"; my $data = construct_fixture kt => $kt, fixture => $fixture, serializer => sub { Data::MessagePack->pack(+shift) };
YAML format or ARRAY reference
Fields:
namespace namespace. type:str(optional) key key name. type:str value value. type:any xt expiration time. see Cache::KyotoTycoon manual
holly <emperor.kurt@gmail.com>
Cache::KyotoTycoon Kwalify YAML::XS
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Test::Fixture::KyotoTycoon, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Fixture::KyotoTycoon
CPAN shell
perl -MCPAN -e shell install Test::Fixture::KyotoTycoon
For more information on module installation, please visit the detailed CPAN module installation guide.