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
6847c472
Commit
6847c472
authored
Aug 18, 2014
by
Mislav Marohnić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add rbenv-install tests
parent
f6e78a4a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
0 deletions
+75
-0
test/rbenv.bats
+75
-0
No files found.
test/rbenv.bats
0 → 100644
View file @
6847c472
#!/usr/bin/env bats
load test_helper
export RBENV_ROOT="${TMP}/rbenv"
setup() {
stub rbenv-hooks 'install : true'
stub rbenv-rehash 'true'
}
stub_ruby_build() {
stub ruby-build "--lib : $BATS_TEST_DIRNAME/../bin/ruby-build --lib" "$@"
}
@test "install proper" {
stub_ruby_build 'echo ruby-build "$@"'
run rbenv-install 2.1.2
assert_success "ruby-build 2.1.2 ${RBENV_ROOT}/versions/2.1.2"
unstub ruby-build
unstub rbenv-hooks
unstub rbenv-rehash
}
@test "install rbenv local version by default" {
stub_ruby_build 'echo ruby-build "$1"'
stub rbenv-local 'echo 2.1.2'
run rbenv-install
assert_success "ruby-build 2.1.2"
unstub ruby-build
unstub rbenv-local
}
@test "list available versions" {
stub_ruby_build \
"--definitions : echo 1.8.7 1.9.3-p0 1.9.3-p194 2.1.2 | tr ' ' $'\\n'"
run rbenv-install --list
assert_success
assert_output <<OUT
Available versions:
1.8.7
1.9.3-p0
1.9.3-p194
2.1.2
OUT
unstub ruby-build
}
@test "nonexistent version" {
stub_ruby_build 'echo ERROR >&2 && exit 2' \
"--definitions : echo 1.8.7 1.9.3-p0 1.9.3-p194 2.1.2 | tr ' ' $'\\n'"
run rbenv-install 1.9.3
assert_failure
assert_output <<OUT
ERROR
The following versions contain \`1.9.3' in the name:
1.9.3-p0
1.9.3-p194
You can list all available versions with \`rbenv install --list'.
If the version you're looking for is not present, first try upgrading
ruby-build. If it's still missing, open a request on the ruby-build
issue tracker: https://github.com/sstephenson/ruby-build/issues
OUT
unstub ruby-build
}
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