aboutsummaryrefslogtreecommitdiffstats
path: root/t/set.t
diff options
context:
space:
mode:
Diffstat (limited to 't/set.t')
-rwxr-xr-xt/set.t124
1 files changed, 124 insertions, 0 deletions
diff --git a/t/set.t b/t/set.t
new file mode 100755
index 0000000..ae44e3a
--- /dev/null
+++ b/t/set.t
@@ -0,0 +1,124 @@
+#!/usr/bin/perl
+# $Id: /local/youri/soft/submit/trunk/t/tags.t 3062 2007-06-28T16:21:35.624871Z guillaume $
+
+use Test::More tests => 7;
+use Test::Exception;
+use Youri::Package::RPM::Test;
+use Youri::Submit::Test::Set;
+
+my $test = Youri::Submit::Test::Set->new(
+ skip => [ 'bar' ]
+);
+
+lives_ok {
+ $test->run(
+ undef,
+ undef,
+ undef,
+ [
+ Youri::Package::RPM::Test->new(tags => {
+ arch => 'noarch'
+ }),
+ Youri::Package::RPM::Test->new(tags => {
+ arch => 'src',
+ })
+ ]
+ )
+} 'one source and one binary package from the same source succeed';
+
+throws_ok {
+ $test->run(
+ undef,
+ undef,
+ undef,
+ [
+ Youri::Package::RPM::Test->new(tags => {
+ arch => 'src'
+ }),
+ Youri::Package::RPM::Test->new(tags => {
+ arch => 'noarch',
+ sourcerpm => 'other-1-1.src.rpm',
+ })
+ ]
+ )
+} qr/not a canonical package set/,
+'one source and one binary packages from different sources fails';
+
+throws_ok {
+ $test->run(
+ undef,
+ undef,
+ undef,
+ [
+ Youri::Package::RPM::Test->new(tags => {
+ arch => 'noarch'
+ })
+ ]
+ )
+} qr/number of source packages < 1/,
+'just one source binary fails';
+
+throws_ok {
+ $test->run(
+ undef,
+ undef,
+ undef,
+ [
+ Youri::Package::RPM::Test->new(tags => {
+ arch => 'src'
+ })
+ ]
+ )
+} qr/number of binary packages < 1/,
+'just one source binary fails';
+
+throws_ok {
+ $test->run(
+ undef,
+ undef,
+ undef,
+ [
+ Youri::Package::RPM::Test->new(tags => {
+ arch => 'src'
+ }),
+ Youri::Package::RPM::Test->new(tags => {
+ arch => 'src'
+ }),
+ ]
+ )
+} qr/number of source packages > 1/,
+'two source packages fails';
+
+lives_ok {
+ $test->run(
+ undef,
+ undef,
+ undef,
+ [
+ Youri::Package::RPM::Test->new(tags => {
+ arch => 'src'
+ }),
+ Youri::Package::RPM::Test->new(tags => {
+ arch => 'noarch'
+ }),
+ Youri::Package::RPM::Test->new(tags => {
+ arch => 'noarch'
+ })
+ ]
+ )
+}
+'one source and two binary packages succedd';
+
+lives_ok {
+ $test->run(
+ undef,
+ undef,
+ undef,
+ [
+ Youri::Package::RPM::Test->new(tags => {
+ name => 'bar',
+ release => '1mdk'
+ })
+ ]
+ )
+} 'non-compliant package with exception succeed';