From dfa0948149351fbdf5702698334156f0e3ff4db8 Mon Sep 17 00:00:00 2001 From: sergiotarxz Date: Mon, 28 Mar 2022 00:01:22 +0200 Subject: [PATCH] Adding a mock object for Peace::Model::Build. --- lib/Peace/Test/Mock/Model/Application.pm | 2 +- lib/Peace/Test/Mock/Model/Build.pm | 51 ++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 lib/Peace/Test/Mock/Model/Build.pm diff --git a/lib/Peace/Test/Mock/Model/Application.pm b/lib/Peace/Test/Mock/Model/Application.pm index 47fe620..640b4be 100644 --- a/lib/Peace/Test/Mock/Model/Application.pm +++ b/lib/Peace/Test/Mock/Model/Application.pm @@ -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 doesn't bring new things to tests by avoiding to add long lines in order to create a L 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 diff --git a/lib/Peace/Test/Mock/Model/Build.pm b/lib/Peace/Test/Mock/Model/Build.pm new file mode 100644 index 0000000..9719a55 --- /dev/null +++ b/lib/Peace/Test/Mock/Model/Build.pm @@ -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 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 mock object. + +=head1 SEE ALSO + +L + +=cut