6 use Test::More 'no_plan';
7 use Test::Deep qw/superhashof cmp_deeply/;
9 use Scalar::Util qw/refaddr/;
11 use ok "Catalyst::Plugin::Cache";
15 use base qw/Catalyst::Plugin::Cache/;
23 bar => bless( {}, "SomeClass" ),
27 sub config { \%config };
36 my $c = bless {}, "MockApp";
38 MockApp->register_cache_backend( default => bless({}, "SomeClass") );
40 can_ok( $c, "curry_cache" );
41 can_ok( $c, "get_preset_curried" );
43 isa_ok( $c->cache, "Catalyst::Plugin::Cache::Curried" );
45 is( refaddr($c->cache), refaddr($c->cache), "default cache is memoized, so it is ==");
47 isa_ok( $c->cache("foo"), "Catalyst::Plugin::Cache::Curried", "cache('foo')" );
49 cmp_deeply( { @{ $c->cache("foo")->meta } }, superhashof({ bah => "foo" }), "meta is in place" );
51 is( refaddr( $c->cache("bar") ), refaddr( $c->cache("bar") ), "since bar is hard coded as an object it's always the same" );