Documentation fix and tests for 0.96_50

[prev] [thread] [next] [Date index for 2004/12/08]

From: Tom Hukins
Subject: Documentation fix and tests for 0.96_50
Date: 17:54 on 08 Dec 2004
--GvXjxJ+pjyke8COw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

I had a quick look at the development version 0.96_50 that Tony posted
to the list a while ago.  I've run some of my code and tests against
it, and noticed no regressions.

I noticed a small error in the documentation, which I have fixed and
added a few tests for.

Tom

--GvXjxJ+pjyke8COw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="cdbi.patch"

diff -ruN Class-DBI-0.96_50.orig/lib/Class/DBI/SearchGenerator.pm Class-DBI-0.96_50/lib/Class/DBI/SearchGenerator.pm
--- Class-DBI-0.96_50.orig/lib/Class/DBI/SearchGenerator.pm	Sun Oct 24 13:50:30 2004
+++ Class-DBI-0.96_50/lib/Class/DBI/SearchGenerator.pm	Fri Dec  3 16:16:11 2004
@@ -43,9 +43,11 @@
 =head2 results
 
 	my @objects = $generator->results;
-	my @iterator = $generator->results;
+	my $iterator = $generator->results;
 
 This will return the objects resulting from running the search.
+In list context, this returns a list of objects.  In scalar
+context, this returns a L<Class::DBI::Iterator> object.
 
 =cut
 
diff -ruN Class-DBI-0.96_50.orig/t/10-mysql.t Class-DBI-0.96_50/t/10-mysql.t
--- Class-DBI-0.96_50.orig/t/10-mysql.t	Sun Oct 24 13:50:30 2004
+++ Class-DBI-0.96_50/t/10-mysql.t	Wed Dec  8 11:58:36 2004
@@ -9,7 +9,7 @@
 eval { require 't/testlib/MyFoo.pm' };
 plan skip_all => "Need MySQL for this test" if $@;
 
-plan tests => 67;
+plan tests => 70;
 
 package main;
 
@@ -198,5 +198,14 @@
 		my @films = MyFilm->search_like(title => "%", { limit => 5 });
 		is @films, 3, "Or 5 (but get 3)";
 	}
+
+        {
+                my $films = MyFilm->search_like(title => "%");
+                isa_ok $films, 'Class::DBI::Iterator';
+                my $count;
+                $count++ while $films->next;
+                is $count, 3, "Iterator search_like";
+                isa_ok $films->first, 'MyFilm', 'Iterator returns films';
+        }
 }
 

--GvXjxJ+pjyke8COw--

Documentation fix and tests for 0.96_50
Tom Hukins 17:54 on 08 Dec 2004

Generated at 13:38 on 10 Dec 2004 by mariachi v0.52