44 lines
1.4 KiB
Perl
44 lines
1.4 KiB
Perl
#!/usr/bin/env perl
|
|
|
|
use v5.30.0;
|
|
|
|
use strict;
|
|
use warnings;
|
|
|
|
use Test::Most tests => 2;
|
|
|
|
use DateTime;
|
|
|
|
use Peace;
|
|
use Peace::DB;
|
|
use Peace::DAO::Developer;
|
|
use Peace::DAO::Application;
|
|
use Peace::DAO::Release;
|
|
use Peace::DAO::Build;
|
|
|
|
use Peace::Test::Mock::Model::Build;
|
|
|
|
{
|
|
my $home = $ENV{HOME};
|
|
my $current_date = DateTime->now;
|
|
my $peace = Peace->new;
|
|
my $config =
|
|
$peace->plugin(
|
|
JSONConfig => { file => "$home/.config/peace/peace.conf" } );
|
|
my $dbh = Peace::DB->dbh( config => $config );
|
|
my $build = Peace::Test::Mock::Model::Build->new;
|
|
my $developer_dao = Peace::DAO::Developer->new( dbh => $dbh );
|
|
my $release_dao = Peace::DAO::Release->new( dbh => $dbh );
|
|
my $application_dao = Peace::DAO::Application->new( dbh => $dbh );
|
|
my $build_dao = Peace::DAO::Build->new( dbh => $dbh );
|
|
$developer_dao->create(
|
|
developer => $build->release->application->developer );
|
|
$build->release->application->app_id(
|
|
'com.example.desfronificator' . rand(10000) );
|
|
$application_dao->create( application => $build->release->application );
|
|
$release_dao->create( release => $build->release );
|
|
$build_dao->create( build => $build );
|
|
ok $build->uuid, 'Uuid was correctly set.';
|
|
ok $build->date_creation > $current_date, 'The new date_creation is meaningful.';
|
|
}
|