Changeset 2144

Show
Ignore:
Timestamp:
04/29/08 21:48:06 (7 months ago)
Author:
mpaschal
Message:

Test by literal values, not from the first object's accessors
Improve test descriptions

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/release-36/t/driver-tests.pl

    r2143 r2144  
    104104} 
    105105 
    106 is_first_foo(scalar Foo->load($foo[0]->id), 'Foo #1 by id'); 
    107 is_first_foo(scalar Foo->load({ id => $foo[0]->id }), 'Foo #1 by id hash'); 
    108 is_first_foo(scalar Foo->load({ id => $foo[0]->id, name => $foo[0]->name }), 'Foo #1 by id-name hash'); 
    109 is_first_foo(scalar Foo->load({ name => $foo[0]->name }), 'Foo #1 by name hash'); 
     106is_first_foo(scalar Foo->load(1), 'Foo #1 by id'); 
     107is_first_foo(scalar Foo->load({ id => 1 }), 'Foo #1 by id hash'); 
     108is_first_foo(scalar Foo->load({ id => 1, name => 'foo' }), 'Foo #1 by id-name hash'); 
     109is_first_foo(scalar Foo->load({ name => 'foo' }), 'Foo #1 by name hash'); 
    110110is_first_foo(scalar Foo->load({ created_on => $foo[0]->created_on }), 'Foo #1 by created_on hash'); 
    111 is_first_foo(scalar Foo->load({ status => $foo[0]->status }), 'Foo #1 by status hash'); 
     111is_first_foo(scalar Foo->load({ status => 2 }), 'Foo #1 by status hash'); 
    112112 
    113113##     Change column value, save, try to load using old value (fail?), 
    114114##     then load again using new value 
    115115$foo[0]->status(0); 
    116 ok($foo[0]->save, 'saved' ); 
     116ok($foo[0]->save, 'Foo #1 saved with new status (0)'); 
    117117$tmp = Foo->load({ status => 2 }); 
    118 ok(!$tmp, 'no Foo'); 
     118ok(!$tmp, 'Foo #1 no longer loads with old status (2)'); 
    119119$tmp = Foo->load({ status => 0 }); 
    120 isa_ok($tmp, 'Foo'); 
    121 is($tmp->id, $foo[0]->id, 'id'); 
    122 is($tmp->status, 0, 'status'); 
     120isa_ok($tmp, 'Foo', 'Foo #1 by new status (0)'); 
     121is($tmp->id, 1, 'Foo #1 still has id of 1'); 
     122is($tmp->status, 0, 'Foo #1 has its new status (0)'); 
    123123 
    124124## Create a new object so we can do range and last/first lookups.