From d06b7b547d13289623dbcf27478f217f6697e735 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Tue, 10 Aug 2010 21:24:21 -0700 Subject: [PATCH] Fix a test with random false fails. --- t/Shop/Vendor.t | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/t/Shop/Vendor.t b/t/Shop/Vendor.t index cccc56c0d..5bc9ef7f9 100644 --- a/t/Shop/Vendor.t +++ b/t/Shop/Vendor.t @@ -122,7 +122,7 @@ cmp_deeply( 'create: requires a session variable', ); -my $now = WebGUI::DateTime->new($session, time); +my $now = time(); eval { $fence = WebGUI::Shop::Vendor->create($session, { userId => $fenceUser->userId, }); }; WebGUI::Test->addToCleanup($fence); @@ -131,9 +131,8 @@ ok(!$e, 'No exception thrown by create'); isa_ok($vendor, 'WebGUI::Shop::Vendor', 'create returns correct type of object'); ok($fence->get('dateCreated'), 'dateCreated is not null'); -my $dateCreated = WebGUI::DateTime->new($session, $fence->get('dateCreated')); -my $deltaDC = $dateCreated - $now; -cmp_ok( $deltaDC->seconds, '<=', 2, 'dateCreated is set properly'); +my $deltaDC = $fence->get('dateCreated') - $now; +cmp_ok( $deltaDC, '<=', 2, 'dateCreated is set properly'); ####################################################################### #