aboutsummaryrefslogtreecommitdiffstats
path: root/t/install.t
diff options
context:
space:
mode:
Diffstat (limited to 't/install.t')
-rwxr-xr-xt/install.t51
1 files changed, 51 insertions, 0 deletions
diff --git a/t/install.t b/t/install.t
new file mode 100755
index 0000000..69113ff
--- /dev/null
+++ b/t/install.t
@@ -0,0 +1,51 @@
+#!/usr/bin/perl
+# $Id: install.t 1426 2006-12-17 21:00:25Z guillomovitch $
+
+use Test::More tests => 3;
+use Test::Exception;
+use Youri::Repository::Test;
+use Youri::Package::RPM::Generator;
+use Youri::Package::RPM::URPM;
+use Youri::Submit::Action::Install;
+
+my $writable_repository = Youri::Repository::Test->new(perms => '755');
+my $unwritable_repository = Youri::Repository::Test->new(perms => '000');
+
+my $action = Youri::Submit::Action::Install->new(
+ skip => [ 'cheater' ]
+);
+
+dies_ok {
+ $action->run(
+ Youri::Package::RPM::URPM->new(
+ file => Youri::Package::RPM::Generator->new()->get_source(),
+ ),
+ $unwritable_repository,
+ undef,
+ undef
+ )
+} 'installing in a non-writable directory';
+
+lives_ok {
+ $action->run(
+ Youri::Package::RPM::URPM->new(
+ file => Youri::Package::RPM::Generator->new(tags => {
+ name => 'cheater',
+ })->get_source(),
+ ),
+ $unwritable_repository,
+ undef,
+ undef
+ )
+} 'installing in a non-writable directory with an exception';
+
+lives_ok {
+ $action->run(
+ Youri::Package::RPM::URPM->new(
+ file => Youri::Package::RPM::Generator->new()->get_source(),
+ ),
+ $writable_repository,
+ undef,
+ undef
+ )
+} 'installing in a writable directory';