]> iEval git - gruntmaster-data.git/blob - t/Gruntmaster-Data.t
3c97f067567fa9729d634a3474ca13fde2038721
[gruntmaster-data.git] / t / Gruntmaster-Data.t
1 #!/usr/bin/perl -w
2 use v5.14;
3
4 use Test::More tests => 6;
5
6 BEGIN { use_ok('Gruntmaster::Data') };
7
8 my $db = Gruntmaster::Data->connect('dbi:SQLite:dbname=:memory:');
9 $db->deploy;
10
11 $db->users->create({id => 'MGV'});
12 $db->contests->create({id => 'fc', start => 10, stop => 20, name => 'Finished contest', owner => 'MGV'});
13 $db->contests->create({id => 'rc', start => 20, stop => 30, name => 'Running contest', owner => 'MGV'});
14 $db->contests->create({id => 'pc', start => 30, stop => 40, name => 'Pending contest', owner => 'MGV'});
15
16 ok $db->contest('pc')->is_pending(25), 'is_pending';
17 ok !$db->contest('rc')->is_pending(25), '!is_pending';
18 ok $db->contest('fc')->is_finished(25), 'is_finished';
19 ok !$db->contest('rc')->is_finished(25), '!is_finished';
20 ok $db->contest('rc')->is_running(25), 'is_running';
This page took 0.045795 seconds and 3 git commands to generate.