]> iEval git - gruntmaster-data.git/blobdiff - t/Gruntmaster-Data.t
Remove no longer useful is_private and is_in_archive methods
[gruntmaster-data.git] / t / Gruntmaster-Data.t
index b3b8672a44ee5d740b03dd97333b8907a005924e..3c97f067567fa9729d634a3474ca13fde2038721 100644 (file)
@@ -1,6 +1,20 @@
 #!/usr/bin/perl -w
 use v5.14;
 
-use Test::More tests => 1;
+use Test::More tests => 6;
 
 BEGIN { use_ok('Gruntmaster::Data') };
+
+my $db = Gruntmaster::Data->connect('dbi:SQLite:dbname=:memory:');
+$db->deploy;
+
+$db->users->create({id => 'MGV'});
+$db->contests->create({id => 'fc', start => 10, stop => 20, name => 'Finished contest', owner => 'MGV'});
+$db->contests->create({id => 'rc', start => 20, stop => 30, name => 'Running contest', owner => 'MGV'});
+$db->contests->create({id => 'pc', start => 30, stop => 40, name => 'Pending contest', owner => 'MGV'});
+
+ok $db->contest('pc')->is_pending(25), 'is_pending';
+ok !$db->contest('rc')->is_pending(25), '!is_pending';
+ok $db->contest('fc')->is_finished(25), 'is_finished';
+ok !$db->contest('rc')->is_finished(25), '!is_finished';
+ok $db->contest('rc')->is_running(25), 'is_running';
This page took 0.020453 seconds and 4 git commands to generate.