-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add -i option to include files prior to exclusion (#30)
- Loading branch information
1 parent
6de6e25
commit 8c61bd4
Showing
2 changed files
with
61 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env bats | ||
|
||
load test_helper | ||
|
||
setup() { | ||
f test/home/user/.dotfile | ||
f test/home/user/.keep | ||
f test/etc/ssh/key | ||
f test/etc/ssh/config | ||
f test/boot/boot | ||
f test/boot/kernel | ||
f test/mnt/5/media | ||
mkstage4.sh \ | ||
-i 'test/home/user/.keep' \ | ||
-e 'user/.*' \ | ||
-i 'test/etc/ssh/config' \ | ||
-e 'ssh' \ | ||
-b \ | ||
-i 'test/boot/boot' \ | ||
-i 'test/mnt/5' \ | ||
-q -t test test | ||
} | ||
|
||
teardown() { | ||
rm -rf test test.tar.bz2 | ||
} | ||
|
||
@test "-i 'test/home/user/.keep and -e 'user/.*'" { | ||
assert_tar_excludes test/home/user/.dotfile | ||
assert_tar_includes test/home/user/.keep | ||
} | ||
|
||
@test "-i 'test/etc/ssh/config and -e 'ssh'" { | ||
assert_tar_excludes test/etc/ssh/key | ||
assert_tar_includes test/etc/ssh/config | ||
} | ||
|
||
@test "-i 'test/boot/boot' and -b" { | ||
assert_tar_excludes test/boot/kernel | ||
assert_tar_includes test/boot/boot | ||
} | ||
|
||
@test "-i 'test/mnt/5'" { | ||
assert_tar_includes test/mnt/5/media | ||
} | ||
|
||
# vim: ft=bash |