aboutsummaryrefslogtreecommitdiffstats
path: root/t/tags.t
diff options
context:
space:
mode:
Diffstat (limited to 't/tags.t')
-rwxr-xr-xt/tags.t55
1 files changed, 55 insertions, 0 deletions
diff --git a/t/tags.t b/t/tags.t
new file mode 100755
index 0000000..4946799
--- /dev/null
+++ b/t/tags.t
@@ -0,0 +1,55 @@
+#!/usr/bin/perl
+# $Id: tags.t 1687 2007-06-28 22:44:07Z guillomovitch $
+
+use Test::More tests => 3;
+use Test::Exception;
+use Youri::Package::RPM::Test;
+use Youri::Submit::Test::Tag;
+
+my $test = Youri::Submit::Test::Tag->new(
+ tags => { release => 'plf$' },
+ skip => [ 'bar' ]
+);
+
+lives_ok {
+ $test->run(
+ undef,
+ undef,
+ undef,
+ [
+ Youri::Package::RPM::Test->new(tags => {
+ name => 'foo',
+ release => '1plf'
+ })
+ ]
+ )
+} 'compliant package succeed';
+
+throws_ok {
+ $test->run(
+ undef,
+ undef,
+ undef,
+ [
+ Youri::Package::RPM::Test->new(tags => {
+ name => 'foo',
+ release => '1mdk'
+ })
+ ]
+ )
+} qr/invalid value 1mdk for tag release/,
+'non-compliant package fails';
+
+lives_ok {
+ $test->run(
+ undef,
+ undef,
+ undef,
+ [
+ Youri::Package::RPM::Test->new(tags => {
+ name => 'bar',
+ release => '1mdk'
+ })
+ ],
+ )
+} 'non-compliant package with exception succeed';