6 use Test::More 'no_plan';
8 use Scalar::Util qw/refaddr/;
10 use ok "Catalyst::Plugin::Cache";
14 use base qw/Catalyst::Plugin::Cache/;
22 bar => bless( {}, "SomeClass" ),
26 sub config { \%config };
35 my $c = bless {}, "MockApp";
37 MockApp->register_cache_backend( default => bless({}, "SomeClass") );
39 can_ok( $c, "curry_cache" );
40 can_ok( $c, "get_preset_curried" );
42 isa_ok( $c->cache, "Catalyst::Plugin::Cache::Curried" );
44 is( refaddr($c->cache), refaddr($c->cache), "default cache is memoized, so it is ==");
46 isa_ok( $c->cache("foo"), "Catalyst::Plugin::Cache::Curried", "cache('foo')" );
48 is_deeply( $c->cache("foo")->meta, [ bah => "foo" ], "meta is in place" );
50 is( refaddr( $c->cache("bar") ), refaddr( $c->cache("bar") ), "since bar is hard coded as an object it's always the same" );