Adding a mock object for Peace::Model::Build.

This commit is contained in:
sergiotarxz 2022-03-28 00:01:22 +02:00
parent 29b115ca00
commit dfa0948149
2 changed files with 52 additions and 1 deletions

View File

@ -40,7 +40,7 @@ Peace::Test::Mock::Model::Application - Mock object for Peace::Model::Applicatio
Peace::Test::Mock::Model::Application aims to reduce repeated code which Peace::Test::Mock::Model::Application aims to reduce repeated code which
doesn't bring new things to tests by avoiding to add long lines doesn't bring new things to tests by avoiding to add long lines
in order to create a L<Peace::Model::Application> object on a in order to create a L<Peace::Model::Application> object on a
unrelated test by providing a stub one already created object. unrelated tests by providing a stub already created object.
=head1 INSTANCE METHODS =head1 INSTANCE METHODS

View File

@ -0,0 +1,51 @@
package Peace::Test::Mock::Model::Build;
use v5.30.0;
use strict;
use warnings;
use Peace::Model::Build;
use Peace::Test::Mock::Model::Release;
sub new {
my $class = shift;
my $release = Peace::Test::Mock::Model::Release->new;
return Peace::Model::Build->new(
release => $release,
arch => 'x86',
);
}
1;
=encoding utf8
=head1 NAME
Peace::Test::Mock::Model::Build - Mock object for Peace::Model::Build.
=head1 SYNOPSIS
my $build = Peace::Test::Mock::Model::Build->new;
=head1 DESCRIPTION
Peace::Test::Mock::Model::Build aims to reduce repeated code which
doesn't bring new things to tests by avoiding to add long lines
in order to create a L<Peace::Model::Build> object on a
unrelated tests by providing a stub already created object.
=head1 INSTANCE METHODS
Peace::Test::Mock::Model::Build provides the following instance methods:
=head2 new
my $build = Peace::Test::Mock::Model::Build->new;
Instances a L<Peace::Model::Build> mock object.
=head1 SEE ALSO
L<Peace::Model::Build>
=cut