File: 008dry.t

package info (click to toggle)
libsysadm-install-perl 0.39-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 336 kB
  • sloc: perl: 734; makefile: 11
file content (33 lines) | stat: -rw-r--r-- 641 bytes parent folder | download | duplicates (7)
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
#############################################
# Tests for Sysadm::Install/s fs_read/write_open
#############################################

use Test::More tests => 3;

use Sysadm::Install qw(:all);

use Log::Log4perl qw(:easy);
Log::Log4perl->easy_init($ERROR);

use File::Spec;
use File::Path;

my $TEST_DIR = ".";
$TEST_DIR = "t" if -d 't';

ok(1, "loading ok");

rmf "$TEST_DIR/tmp";
mkd "$TEST_DIR/tmp";

Sysadm::Install::dry_run(1);
blurt "abc", "$TEST_DIR/tmp/abc";

ok(!-f "$TEST_DIR/tmp/abc", "dry run");

Sysadm::Install::dry_run(0);
blurt "abc", "$TEST_DIR/tmp/abc";

ok(-f "$TEST_DIR/tmp/abc", "dry run");

rmf "$TEST_DIR/tmp";