Skip to content

Commit 555461b

Browse files
authored
Fix unit test for permissions when umask is different (#112)
* Set predictable umask for permissions test. Fixes 111 * Update comment
1 parent 44e1f34 commit 555461b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tests/unit_test.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ test_get_children() {
113113

114114
test_get_permissions() {
115115
result=`get_permissions "${stdoutF}"`
116-
expected='-rw-r--r--' #check if default permission is 744
116+
expected='-rw-r-----' # Check if permission is 640
117117
assertEquals \
118118
"the result of get_permissions() was wrong" \
119119
"${expected}" "${result}"
@@ -134,6 +134,9 @@ test_check_authentication() {
134134

135135

136136
oneTimeSetUp() {
137+
# We need a predictable umask for the test_get_permissions.
138+
umask 027
139+
#
137140
outputDir="${SHUNIT_TMPDIR}/output"
138141
mkdir "${outputDir}"
139142
stdoutF="${outputDir}/stdout"

0 commit comments

Comments
 (0)