use strict;
use warnings;
-use Test::More plan => 1;
+use Test::More tests => 3;
+use Test::Moose;
+
+BEGIN {
+ use_ok('Moose');
+}
=head1 NAME
This package defines the following tests.
-=head2 Create Test Class
+=head2 Define Test Class
Create a class that uses L<MooseX::Attribute::Cached> and has some attributes
that are cached.
=cut
+{
+ ## Stub for the meta attribute trait.
+ package MooseX::Attribute::Cached::Meta::Attribute::Trait::Cached;
+ use Moose::Role;
+
+ has 'cache' => (
+ is=>'ro',
+ );
+
+ around 'set_value' => sub {
+ my ($set_value, $self, $instance, $value) = @_;
+ warn "detected set_value";
+ $self->$set_value($value);
+ };
+
+ 1;
+
+ ## meta attribute needs registering.
+ package Moose::Meta::Attribute::Custom::Trait::Cached;
+ sub register_implementation {
+ 'MooseX::Attribute::Cached::Meta::Attribute::Trait::Cached';
+ }
+
+ 1;
+
+ ## Test Class
+
+ package MooseX::Attribute::Cached::Test;
+ use Moose;
+
+ has 'manual_config' => (
+ is=>'rw',
+ traits=>['Cached'],
+ );
+
+ 1;
+}
+
+
+=head2 Test Instantiation
+
+Can we create a test instance and make sure it's basic methods work as we
+expect.
+
+=cut
+
+ok my $cached_attrs = MooseX::Attribute::Cached::Test->new()
+ => 'Created a good Object';
+
+isa_ok $cached_attrs => 'MooseX::Attribute::Cached::Test'
+ => 'Got the correct Object';
+
+ ## Let's create a couple extra instances that all hook up to this given
+ ## caching system for attributes.
+
+ my @instances = map {
+ MooseX::Attribute::Cached::Test->new()
+ } (1..5);
+
+
+=head2 Test Cached Attributes.
+
+Check that the stores the values, that the lazy builders work, that the
+inflater/deflaters work, etc.
+
+=cut
+
+$cached_attrs->manual_config(1);
+$cached_attrs->manual_config(2);
+use Data::Dump qw/dump/;
+
+warn dump $cached_attrs->meta;
+
+=head2 Test Cache Object.
+
+Tests to make sure the Underlying Cached object is behavior as expected.
=head1 AUTHOR
=head1 COPYRIGHT & LICENSE
-Copyright 2008 John Napiorkowski, all rights reserved.
+Copyright 2008 John Napiorkowski
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.