|
From: Chris W. <la...@us...> - 2001-11-26 16:27:23
|
Update of /cvsroot/openinteract/SPOPS/t
In directory usw-pr-cvs1:/tmp/cvs-serv32210/t
Modified Files:
30_dbi.t 31_dbi_multifield.t
Log Message:
fixed behavior in clone() method -- multifield checks are now
generated by the multifield class factory behavior, and the previous
clone() behavior has been restored. (Thanks to Ray Z for catching.)
Index: 30_dbi.t
===================================================================
RCS file: /cvsroot/openinteract/SPOPS/t/30_dbi.t,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** 30_dbi.t 2001/11/04 17:54:26 1.4
--- 30_dbi.t 2001/11/26 16:27:19 1.5
***************
*** 101,105 ****
{
my $obj = eval { $SPOPS_CLASS->fetch( 42, { db => $db, skip_cache => 1 } ) };
! my $new_obj = eval { $obj->clone({ spops_name => 'YourProject',
spops_goop => 'this n that',
spops_id => 1792 } ) };
--- 101,105 ----
{
my $obj = eval { $SPOPS_CLASS->fetch( 42, { db => $db, skip_cache => 1 } ) };
! my $new_obj = eval { $obj->clone({ spops_name => 'YourProject',
spops_goop => 'this n that',
spops_id => 1792 } ) };
***************
*** 117,123 ****
# field and see if the default comes through
{
! my $obj = $SPOPS_CLASS->new({ spops_id => 1588,
! spops_goop => 'here we go!',
! spops_name => 'AnotherProject' });
eval { $obj->save({ is_add => 1, db => $db, skip_cache => 1 }) };
ok( $obj->{spops_num} == 2, 'Fetch object (correct data with default' );
--- 117,123 ----
# field and see if the default comes through
{
! my $obj = $SPOPS_CLASS->new({ spops_id => 1588,
! spops_goop => 'here we go!',
! spops_name => 'AnotherProject' });
eval { $obj->save({ is_add => 1, db => $db, skip_cache => 1 }) };
ok( $obj->{spops_num} == 2, 'Fetch object (correct data with default' );
Index: 31_dbi_multifield.t
===================================================================
RCS file: /cvsroot/openinteract/SPOPS/t/31_dbi_multifield.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** 31_dbi_multifield.t 2001/11/25 01:26:47 1.2
--- 31_dbi_multifield.t 2001/11/26 16:27:19 1.3
***************
*** 30,38 ****
# Ensure we can get to SPOPS::Initialize
!
require_ok( 'SPOPS::Initialize' );
# Create the class using SPOPS::Initialize
!
my $spops_config = {
tester => {
--- 30,38 ----
# Ensure we can get to SPOPS::Initialize
! # TEST: 1
require_ok( 'SPOPS::Initialize' );
# Create the class using SPOPS::Initialize
! # TEST: 2-3
my $spops_config = {
tester => {
***************
*** 61,64 ****
--- 61,65 ----
# Create an object
+ # TEST: 4-5
{
my $obj = eval { $SPOPS_CLASS->new({ spops_name => 'MyProject',
***************
*** 79,82 ****
--- 80,84 ----
# Fetch an object, then update it
+ # TEST: 6-9
{
my $obj = eval { $SPOPS_CLASS->fetch( "$obj_time,$obj_user", { db => $db, skip_cache => 1 } ) };
***************
*** 101,104 ****
--- 103,107 ----
# Fetch an object then clone it and save it
+ # TEST: 10-12
{
my $obj = eval { $SPOPS_CLASS->fetch( "$obj_time,$obj_user", { db => $db, skip_cache => 1 } ) };
***************
*** 108,111 ****
--- 111,115 ----
ok( ! $@, 'Clone object (perform)' );
ok( $new_obj->{spops_name} ne $obj->{spops_name}, 'Clone object (correct data)');
+ $new_obj->{spops_user} = 12;
eval { $new_obj->save( { is_add => 1, db => $db, skip_cache => 1 } ) };
***************
*** 118,121 ****
--- 122,126 ----
# Create another object, but this time don't define the spops_num
# field and see if the default comes through
+ # TEST: 13
{
my $obj = $SPOPS_CLASS->new({ spops_time => 1004897292,
***************
*** 128,131 ****
--- 133,137 ----
# Fetch the three objects in the db and be sure we got them all
+ # TEST: 14-15
{
my $obj_list = eval { $SPOPS_CLASS->fetch_group({ db => $db, skip_cache => 1 } ) };
***************
*** 139,142 ****
--- 145,149 ----
# Fetch a count of the objects in the database
+ # TEST: 16
{
my $obj_count = eval { $SPOPS_CLASS->fetch_count({ db => $db }) };
***************
*** 145,148 ****
--- 152,156 ----
# Create an iterator and run through the objects
+ # TEST: 17-18
{
my $iter = eval { $SPOPS_CLASS->fetch_iterator({ db => $db, skip_cache => 1 }) };
|