Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
ruby-build
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ruby-build
Commits
eae699d6
Commit
eae699d6
authored
Jan 04, 2014
by
Mislav Marohnić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for `rbenv install/uninstall` hooks
parent
4d8319bd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
0 deletions
+56
-0
test/hooks.bats
+56
-0
No files found.
test/hooks.bats
0 → 100644
View file @
eae699d6
#!/usr/bin/env bats
load test_helper
setup() {
export RBENV_ROOT="${TMP}/rbenv"
export HOOK_PATH="${TMP}/i has hooks"
mkdir -p "$HOOK_PATH"
}
@test "rbenv-install hooks" {
cat > "${HOOK_PATH}/install.bash" <<OUT
before_install 'echo before: \$PREFIX'
after_install 'echo after: \$STATUS'
OUT
stub rbenv-hooks "install : echo '$HOOK_PATH'/install.bash"
stub rbenv-rehash "echo rehashed"
definition="${TMP}/2.0.0"
cat > "$definition" <<<"echo ruby-build"
run rbenv-install "$definition"
assert_success
assert_output <<-OUT
before: ${RBENV_ROOT}/versions/2.0.0
ruby-build
after: 0
rehashed
OUT
}
@test "rbenv-uninstall hooks" {
cat > "${HOOK_PATH}/uninstall.bash" <<OUT
before_uninstall 'echo before: \$PREFIX'
after_uninstall 'echo after.'
rm() {
echo "rm \$@"
command rm "\$@"
}
OUT
stub rbenv-hooks "uninstall : echo '$HOOK_PATH'/uninstall.bash"
stub rbenv-rehash "echo rehashed"
mkdir -p "${RBENV_ROOT}/versions/2.0.0"
run rbenv-uninstall -f 2.0.0
assert_success
assert_output <<-OUT
before: ${RBENV_ROOT}/versions/2.0.0
rm -rf ${RBENV_ROOT}/versions/2.0.0
rehashed
after.
OUT
assert [ ! -d "${RBENV_ROOT}/versions/2.0.0" ]
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment