37 lines
770 B
Perl
37 lines
770 B
Perl
|
use 5.32.1;
|
||
|
|
||
|
use Test::Most tests => 4;
|
||
|
use Test::Warnings ':all';
|
||
|
|
||
|
use strict;
|
||
|
use warnings;
|
||
|
|
||
|
{
|
||
|
use_ok 'BeastBB::Response';
|
||
|
}
|
||
|
|
||
|
{
|
||
|
like(
|
||
|
warning {
|
||
|
BeastBB::Response->new(
|
||
|
is_error => 1,
|
||
|
content => 'example_content', error_message => 'example_error'
|
||
|
)
|
||
|
},
|
||
|
qr/Error should not have content/,
|
||
|
'BeastBB::Response warns on construction if is_error is true and content is passed.'
|
||
|
);
|
||
|
}
|
||
|
|
||
|
{
|
||
|
like(
|
||
|
warning {
|
||
|
BeastBB::Response->new(
|
||
|
is_error => 1,
|
||
|
)
|
||
|
},
|
||
|
qr/You should pass a error message on error\./,
|
||
|
'BeastBB::Response warns on construction if is_error is true and error message is not passed.'
|
||
|
);
|
||
|
}
|