Skip to content

Commit

Permalink
ensure that exec and skip work together
Browse files Browse the repository at this point in the history
  • Loading branch information
justone committed May 22, 2012
1 parent 2a814ba commit bc9f0ad
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions t/01.simple.t
Expand Up @@ -176,13 +176,15 @@ subtest 'exec option' => sub {
focus('exec_option');

my ( $home, $repo, $origin );
( $home, $repo, $origin )
= minimum_home( 'exec_option',
{ dfminstall_contents => "test1/script1.sh exec\ntest2 recurse" } );
( $home, $repo, $origin ) = minimum_home(
'exec_option',
{ dfminstall_contents =>
"script1.sh exec\nscript1.sh skip\ntest2 recurse"
}
);

# set up non-recurse script that needs to be set executable
`mkdir -p $repo/test1`;
`echo "#!/bin/sh\n\necho 'message1';\ntouch testfile" > $repo/test1/script1.sh`;
`echo "#!/bin/sh\n\necho 'message1';\ntouch testfile" > $repo/script1.sh`;

# set up recurse script that is already executable
`mkdir -p $repo/test2`;
Expand All @@ -193,8 +195,9 @@ subtest 'exec option' => sub {
my $output = `HOME=$home perl $repo/bin/dfm --verbose`;

like( $output, qr/message1/, 'output contains output from script1' );
ok( -e "$home/testfile", 'file created by script1 exists' );
ok( -x "$repo/test1/script1.sh", 'script1 file is executable' );
ok( -e "$home/testfile", 'file created by script1 exists' );
ok( !-e "$home/script1.sh", 'script1 is not symlinked into home' );
ok( -x "$repo/script1.sh", 'script1 file is executable' );

like( $output, qr/message2/, 'output contains output from script2' );
ok( -e "$home/test2/testfile2", 'file created by script2 exists' );
Expand Down

0 comments on commit bc9f0ad

Please sign in to comment.