[Bps-public-commit] r14252 - in Prophet/trunk: . t

sartak at bestpractical.com sartak at bestpractical.com
Thu Jul 17 23:56:54 EDT 2008


Author: sartak
Date: Thu Jul 17 23:56:53 2008
New Revision: 14252

Added:
   Prophet/trunk/t/default.t
Modified:
   Prophet/trunk/   (props changed)
   Prophet/trunk/t/lib/TestApp/Bug.pm

Log:
 r64552 at onn:  sartak | 2008-07-17 23:56:45 -0400
 Test for defaults


Added: Prophet/trunk/t/default.t
==============================================================================
--- (empty file)
+++ Prophet/trunk/t/default.t	Thu Jul 17 23:56:53 2008
@@ -0,0 +1,23 @@
+use warnings;
+use strict;
+use Test::More  tests => 7;
+use File::Temp qw'tempdir';
+use lib 't/lib';
+
+use_ok('Prophet::CLI');
+$ENV{'PROPHET_REPO'} = tempdir( CLEANUP => 0 ) . '/repo-' . $$;
+my $cli = Prophet::CLI->new();
+my $cxn = $cli->app_handle->handle;
+isa_ok($cxn, 'Prophet::Replica');
+
+use_ok('TestApp::Bug');
+
+my $record = TestApp::Bug->new( handle => $cxn );
+
+isa_ok( $record, 'TestApp::Bug' );
+isa_ok( $record, 'Prophet::Record' );
+
+my $uuid = $record->create( props => { name => 'Jesse', email => 'JeSsE at bestPractical.com' } );
+ok($uuid);
+is( $record->prop('status'), 'new', "default status" );
+

Modified: Prophet/trunk/t/lib/TestApp/Bug.pm
==============================================================================
--- Prophet/trunk/t/lib/TestApp/Bug.pm	(original)
+++ Prophet/trunk/t/lib/TestApp/Bug.pm	Thu Jul 17 23:56:53 2008
@@ -22,4 +22,6 @@
     $args{props}->{email} = lc( $args{props}->{email} );
 }
 
+sub default_prop_status { 'new' }
+
 1;



More information about the Bps-public-commit mailing list