Преглед изворни кода

Fix test suite when no system Ruby exists

Some tests assumed that the `ruby` executable will be found in system PATH.

Fixes #512, closes #514
pull/360/head^2
Jeffrey 'jf' Lim пре 12 година
committed by Mislav Marohnić
родитељ
комит
4f2f6f8575
1 измењених фајлова са 12 додато и 0 уклоњено
  1. +12
    -0
      test/versions.bats

+ 12
- 0
test/versions.bats Прегледај датотеку

@ -11,7 +11,14 @@ setup() {
cd "$RBENV_TEST_DIR"
}
stub_system_ruby() {
local stub="${RBENV_TEST_DIR}/bin/ruby"
mkdir -p "$(dirname "$stub")"
touch "$stub" && chmod +x "$stub"
}
@test "no versions installed" {
stub_system_ruby
assert [ ! -d "${RBENV_ROOT}/versions" ]
run rbenv-versions
assert_success "* system (set by ${RBENV_ROOT}/version)"
@ -24,6 +31,7 @@ setup() {
}
@test "single version installed" {
stub_system_ruby
create_version "1.9"
run rbenv-versions
assert_success
@ -40,6 +48,7 @@ OUT
}
@test "multiple versions" {
stub_system_ruby
create_version "1.8.7"
create_version "1.9.3"
create_version "2.0.0"
@ -54,6 +63,7 @@ OUT
}
@test "indicates current version" {
stub_system_ruby
create_version "1.9.3"
create_version "2.0.0"
RBENV_VERSION=1.9.3 run rbenv-versions
@ -77,6 +87,7 @@ OUT
}
@test "globally selected version" {
stub_system_ruby
create_version "1.9.3"
create_version "2.0.0"
cat > "${RBENV_ROOT}/version" <<<"1.9.3"
@ -90,6 +101,7 @@ OUT
}
@test "per-project version" {
stub_system_ruby
create_version "1.9.3"
create_version "2.0.0"
cat > ".ruby-version" <<<"1.9.3"

Loading…
Откажи
Сачувај