sub table { shift->global_options->{table} }
-Gruntmaster::Data::init $ENV{GRUNTMASTER_DSN} // 'dbi:Pg:';
+dbinit $ENV{GRUNTMASTER_DSN} // 'dbi:Pg:';
1;
__END__
use parent qw/Exporter/;
our $VERSION = '5999.000_013';
-our @EXPORT = qw/purge db user_list user_entry problem_list problem_entry contest_list contest_entry contest_has_problem job_list job_entry create_job standings update_status rerun_job take_job finish_job/; ## no critic (ProhibitAutomaticExportation)
+our @EXPORT = qw/dbinit purge db user_list user_entry problem_list problem_entry contest_list contest_entry contest_has_problem job_list job_entry create_job standings update_status rerun_job take_job finish_job/; ## no critic (ProhibitAutomaticExportation)
use JSON::MaybeXS qw/decode_json/;
use HTTP::Tiny;
our $db;
sub db () { $db }
-sub init {
+sub dbinit {
$db = DBIx::Simple->new(@_);
$db->keep_statements = 100;
};
BEGIN {
eval {
- Gruntmaster::Data::init 'dbi:Pg:dbname=gmtest'; 1;
+ dbinit 'dbi:Pg:dbname=gmtest'; 1;
} or plan skip_all => 'Cannot connect to test database. Create it by running createdb gmtest before running this test. '. "Error: $@";
plan tests => 33;
}
BEGIN {
eval {
- Gruntmaster::Data::init 'dbi:Pg:dbname=gmtest'; 1;
+ dbinit 'dbi:Pg:dbname=gmtest'; 1;
} or plan skip_all => 'Cannot connect to test database. Create it by running make_test_db.sh before running this test. '. "Error: $@";
plan tests => 30;
}