6 use Test::More tests => 3;
15 001_basic.t; tests the overall basic functionality
19 Create a L<Moose> class that uses the Caching role and the try out the basic
20 functionality. This test uses L<Cache::FastMmap> as the default cache storage
21 but you can override that with the following %ENV to test against your local
22 L<Cache::Memcached> based caching server:
24 TDB write code for %ENV
28 This package defines the following tests.
30 =head2 Define Test Class
32 Create a class that uses L<MooseX::Attribute::Cached> and has some attributes
38 ## Stub for the meta attribute trait.
39 package MooseX::Attribute::Cached::Meta::Attribute::Trait::Cached;
46 around 'set_value' => sub {
47 my ($set_value, $self, $instance, $value) = @_;
48 warn "detected set_value";
49 $self->$set_value($value);
54 ## meta attribute needs registering.
55 package Moose::Meta::Attribute::Custom::Trait::Cached;
56 sub register_implementation {
57 'MooseX::Attribute::Cached::Meta::Attribute::Trait::Cached';
64 package MooseX::Attribute::Cached::Test;
67 has 'manual_config' => (
76 =head2 Test Instantiation
78 Can we create a test instance and make sure it's basic methods work as we
83 ok my $cached_attrs = MooseX::Attribute::Cached::Test->new()
84 => 'Created a good Object';
86 isa_ok $cached_attrs => 'MooseX::Attribute::Cached::Test'
87 => 'Got the correct Object';
89 ## Let's create a couple extra instances that all hook up to this given
90 ## caching system for attributes.
93 MooseX::Attribute::Cached::Test->new()
97 =head2 Test Cached Attributes.
99 Check that the stores the values, that the lazy builders work, that the
100 inflater/deflaters work, etc.
104 $cached_attrs->manual_config(1);
105 $cached_attrs->manual_config(2);
106 use Data::Dump qw/dump/;
108 warn dump $cached_attrs->meta;
110 =head2 Test Cache Object.
112 Tests to make sure the Underlying Cached object is behavior as expected.
116 John Napiorkowski, C<< <john.napiorkowski at takkle.com> >>
118 =head1 COPYRIGHT & LICENSE
120 Copyright 2008 John Napiorkowski
122 This program is free software; you can redistribute it and/or modify it
123 under the same terms as Perl itself.