aboutsummaryrefslogtreecommitdiffstats
path: root/t/install.t
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-06-29 13:30:24 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-06-29 13:30:24 +0000
commit6cbb51a6bf5f4ccfc3388ce39a3bbd5b14a91217 (patch)
tree7e5723a41d828799e9759547bfd72c0133ba297f /t/install.t
downloadmga-youri-submit-upstream.tar
mga-youri-submit-upstream.tar.gz
mga-youri-submit-upstream.tar.bz2
mga-youri-submit-upstream.tar.xz
mga-youri-submit-upstream.zip
prepare mergeupstream
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';