-
-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
warn user that installation will fail if she doesn't have necessary w…
…rite permission
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 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,30 @@ | ||
#!/usr/bin/env bash | ||
|
||
. ./test/helper.sh | ||
|
||
test_install_dir="$test_fixtures_dir/no_permission_warn_test" | ||
|
||
function setUp() | ||
{ | ||
mkdir -p "$test_install_dir" | ||
chmod -w "$test_install_dir" | ||
} | ||
|
||
function test_no_install_when_write_permissions_lacking() | ||
{ | ||
local output | ||
local status | ||
|
||
output="$(ruby-install --install-dir "$test_install_dir" ruby 2>&1)" || status=$? | ||
|
||
assertEquals "did not return 0" 255 $status | ||
assertTrue "did not print a message to STDOUT" \ | ||
'[[ "$output" == *"Installation directory is not writable by the user: ${install_dir}"* ]]' | ||
} | ||
|
||
function tearDown() | ||
{ | ||
rm -rf "$test_install_dir" | ||
} | ||
|
||
SHUNIT_PARENT=$0 . $SHUNIT2 |