--- t/05-cache.t 2008/06/27 17:53:30 227 +++ t/05-cache.t 2008/06/27 19:09:13 228 @@ -8,7 +8,7 @@ =cut -use Jifty::Test tests => 11; +use Jifty::Test tests => 14; use Data::Dump qw/dump/; @@ -33,9 +33,17 @@ ok( $strix->write_cache( $data, 'test-scalar' ), 'write_cache scalar' ); is_deeply( $strix->read_cache( 'test-scalar' ), $data, 'read_cache scalar' ); } + $data = { foo => 42, bar => 'baz' }; ok( $strix->write_cache( $data, 'test-hash' ), 'write_cache hash' ); is_deeply( $strix->read_cache( 'test-hash' ), $data, 'read_cache hash' ); + +bless $data, 'foo'; +like( ref($data), qr/foo/, 'data blessed' ); +diag "blessed = ",dump( $data ) if $debug; +ok( $strix->write_cache( $data, 'test-blessed' ), 'write_cache blessed' ); +is_deeply( $strix->read_cache( 'test-blessed' ), $data, 'read_cache blessed' ); + $data = [ 1, 2, 42 ]; ok( $strix->write_cache( $data, 'test-array' ), 'write_cache array' ); is_deeply( $strix->read_cache( 'test-array' ), $data, 'read_cache array' );