blob: 69113ff75f7d425247bb7eeb43cc0dcf02f8bcd1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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';
|