Skip to content

Commit

Permalink
(maint) add source to expected test results
Browse files Browse the repository at this point in the history
also closes #89
  • Loading branch information
eputnam committed May 16, 2017
1 parent 1a2d7ee commit e0bc9a8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
10 changes: 7 additions & 3 deletions manifests/get.pp
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,15 @@
}

if $chmod {
$myChmod = "--chmod=${chmod}"
$mychmod = "--chmod=${chmod}"
} else {
$mychmod = undef
}

if $logfile {
$myLogfile = "--log-file=${logfile}"
$mylogfile = "--log-file=${logfile}"
} else {
$mylogfile = undef
}

if $include or $exclude {
Expand All @@ -140,7 +144,7 @@

$rsync_options = join(
delete_undef_values([$options, $myPurge, $excludeAndInclude, $myLinks, $myHardLinks, $myCopyLinks, $myTimes,
$myRecursive, $myChown, $myChmod, $myLogfile, "${myUser}${source}", $path]), ' ')
$myRecursive, $myChown, $mychmod, $mylogfile, "${myUser}${source}", $path]), ' ')

if !$onlyif {
$onlyif_real = "test `rsync --dry-run --itemize-changes ${rsync_options} | wc -l` -gt 0"
Expand Down
12 changes: 6 additions & 6 deletions spec/defines/get_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@

it {
is_expected.to contain_exec("rsync foobar").with({
'command' => 'rsync -q -a --chown=user:group foobar',
'onlyif' => "test `rsync --dry-run --itemize-changes -a --chown=user:group foobar | wc -l` -gt 0"
'command' => 'rsync -q -a --chown=user:group example.com foobar',
'onlyif' => "test `rsync --dry-run --itemize-changes -a --chown=user:group example.com foobar | wc -l` -gt 0"
})
}
end
Expand All @@ -300,8 +300,8 @@

it {
is_expected.to contain_exec("rsync foobar").with({
'command' => 'rsync -q -a --chmod=Dg-s,u+w,go-w,+X,+x foobar',
'onlyif' => "test `rsync --dry-run --itemize-changes -a --chmod=Dg-s,u+w,go-w,+X,+x foobar | wc -l` -gt 0"
'command' => 'rsync -q -a --chmod=Dg-s,u+w,go-w,+X,+x example.com foobar',
'onlyif' => "test `rsync --dry-run --itemize-changes -a --chmod=Dg-s,u+w,go-w,+X,+x example.com foobar | wc -l` -gt 0"
})
}
end
Expand All @@ -313,8 +313,8 @@

it {
is_expected.to contain_exec("rsync foobar").with({
'command' => 'rsync -q -a --log-file=/tmp/logfile.out foobar',
'onlyif' => "test `rsync --dry-run --itemize-changes -a --log-file=/tmp/logfile.out foobar | wc -l` -gt 0"
'command' => 'rsync -q -a --log-file=/tmp/logfile.out example.com foobar',
'onlyif' => "test `rsync --dry-run --itemize-changes -a --log-file=/tmp/logfile.out example.com foobar | wc -l` -gt 0"
})
}
end
Expand Down

0 comments on commit e0bc9a8

Please sign in to comment.