diff options
Diffstat (limited to 't/sign.t')
-rwxr-xr-x | t/sign.t | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/t/sign.t b/t/sign.t new file mode 100755 index 0000000..db6f619 --- /dev/null +++ b/t/sign.t @@ -0,0 +1,57 @@ +#!/usr/bin/perl +# $Id: sign.t 1407 2006-12-03 12:02:02Z guillomovitch $ + +use Test::More tests => 3; +use Test::Exception; +use File::Basename; +use Youri::Package::RPM::Generator; +use Youri::Package::RPM::URPM; +use Youri::Submit::Action::Sign; + +my $action1 = Youri::Submit::Action::Sign->new( + name => 'Youri', + path => dirname($0) . '/gpghome', + passphrase => 'Youri sux', + skip => [ 'cheater' ] +); + +dies_ok { + $action1->run( + Youri::Package::RPM::URPM->new( + file => Youri::Package::RPM::Generator->new()->get_source(), + ), + undef, + undef, + undef + ) +} 'signing with wrong key'; + +lives_ok { + $action1->run( + Youri::Package::RPM::URPM->new( + file => Youri::Package::RPM::Generator->new(tags => { + name => 'cheater', + })->get_source(), + ), + undef, + undef, + undef + ) +} 'signing with wrong key using an exception'; + +my $action2 = Youri::Submit::Action::Sign->new( + name => 'Youri', + path => dirname($0) . '/gpghome', + passphrase => 'Youri rulez', +); + +lives_ok { + $action2->run( + Youri::Package::RPM::URPM->new( + file => Youri::Package::RPM::Generator->new()->get_source(), + ), + undef, + undef, + undef + ) +} 'signing with correct key'; |