--- /dev/null
+Revision history for DBIx::Class::Cursor::Cached
+
+1.0.1 7 August 2007 12:37:00
+ - Fixed bug in next() as spotted by atsushi kobayashi
+
+1.0.0 6 August 2007 17:38:00
+ - initial release
use inc::Module::Install 0.67;
name 'DBIx-Class-Cursor-Cached';
+version '1.0.1';
all_from 'lib/DBIx/Class/Cursor/Cached.pm';
requires 'DBIx::Class' => '0.08004';
requires 'Digest::SHA1';
+build_requires 'Test::More';
+build_requires 'Cache::FileCache';
+
auto_install;
WriteAll;
use vars qw($VERSION);
-$VERSION = '0.999001_01';
+$VERSION = '1.000001';
sub new {
my $class = shift;
sub next {
my ($self) = @_;
- return @{($self->{data} ||= $self->_fill_data)->{$self->{pos}++}||[]};
+ return @{($self->{data} ||= $self->_fill_data)->[$self->{pos}++]||[]};
}
sub all {
use DBIx::Class::Cursor::Cached;
use Test::More 'no_plan';
+mkdir('t/var');
unlink('t/var/test.db');
my ($dsn, $user, $pass) = ('dbi:SQLite:t/var/test.db');
SchemaClass->connect($dsn,$user,$pass)->init;
-require Data::Dumper;
-
my $expect_data = [ [ 1, 'CD one' ], [ 2, 'CD two' ] ];
{ ## start test block
ok(!defined($cache->get($rs->cursor->cache_key)), 'cache cleared');
- @cds = $rs->all; # refills cache
+ @cds = (); while (my $rec = $rs->next) { push(@cds, $rec); }
is_deeply([ map { [ $_->id, $_->title ] } @cds ], $expect_data,
'correct data in objects');