[Bps-public-commit] r10888 - in SVN-PropDB/t: lib/TestApp

jesse at bestpractical.com jesse at bestpractical.com
Tue Feb 19 19:01:34 EST 2008


Author: jesse
Date: Tue Feb 19 19:01:32 2008
New Revision: 10888

Added:
   SVN-PropDB/t/canonicalize.t
Modified:
   SVN-PropDB/t/lib/TestApp/Bug.pm

Log:
* now we support canonicalizers

Added: SVN-PropDB/t/canonicalize.t
==============================================================================
--- (empty file)
+++ SVN-PropDB/t/canonicalize.t	Tue Feb 19 19:01:32 2008
@@ -0,0 +1,27 @@
+use warnings;
+use strict;
+use Test::More 'no_plan';
+use File::Temp qw'tempdir';
+use lib 't/lib';
+
+use_ok('SVN::PropDB::Handle');
+my $REPO= tempdir(CLEANUP => 0).'/repo-'.$$;
+ok(! -d $REPO);
+`svnadmin create $REPO`;
+ok(-d $REPO, "The repo exists ater svnadmin create");
+my $cxn = SVN::PropDB::Handle->new( repository => "$REPO", db_root => '/_propdb-test');
+isa_ok($cxn, 'SVN::PropDB::Handle', "Got the cxn");
+use_ok('TestApp::Bug');
+
+my $record = TestApp::Bug->new(handle => $cxn);
+
+
+isa_ok($record, 'TestApp::Bug');
+isa_ok($record, 'SVN::PropDB::Record');
+
+
+
+my $uuid  = $record->create(props => { name => 'Jesse', email => 'JeSsE at bestPractical.com' });
+ok($uuid);
+is($record->prop('email'), 'jesse at bestpractical.com');
+

Modified: SVN-PropDB/t/lib/TestApp/Bug.pm
==============================================================================
--- SVN-PropDB/t/lib/TestApp/Bug.pm	(original)
+++ SVN-PropDB/t/lib/TestApp/Bug.pm	Tue Feb 19 19:01:32 2008
@@ -18,5 +18,10 @@
 
 }
 
+sub canonicalize_email {
+    my $self = shift;
+    my %args = (@_);
+    $args{props}->{email} = lc($args{props}->{email});
+}
 
 1;



More information about the Bps-public-commit mailing list