Move rbenv-install/uninstall tests to rbenv.bats

This commit is contained in:
Mislav Marohnić 2014-11-26 20:39:13 -08:00
parent 3ae43a44e2
commit 96d9cbe77c
2 changed files with 26 additions and 30 deletions

View file

@ -21,33 +21,3 @@ load test_helper
assert_failure
assert_output_contains 'Usage: ruby-build'
}
@test "extra arguments for rbenv-install" {
stub ruby-build "--lib : $BATS_TEST_DIRNAME/../bin/ruby-build --lib"
stub rbenv-hooks
stub rbenv-rehash
run rbenv-install 2.1.1 2.1.2
assert_failure
assert_output_contains 'Usage: rbenv install'
unstub ruby-build
unstub rbenv-hooks
unstub rbenv-rehash
}
@test "not enough arguments rbenv-uninstall" {
run rbenv-uninstall
assert_failure
assert_output_contains 'Usage: rbenv uninstall'
}
@test "extra arguments for rbenv-uninstall" {
stub rbenv-hooks
run rbenv-uninstall 2.1.1 2.1.2
assert_failure
assert_output_contains 'Usage: rbenv uninstall'
unstub rbenv-hooks
}

View file

@ -146,3 +146,29 @@ ${RBENV_ROOT}/plugins/bar/share/ruby-build
${RBENV_ROOT}/plugins/foo/share/ruby-build
OUT
}
@test "not enough arguments for rbenv-install" {
stub_ruby_build
run rbenv-install
assert_failure
assert_output_contains 'Usage: rbenv install'
}
@test "too many arguments for rbenv-install" {
stub_ruby_build
run rbenv-install 2.1.1 2.1.2
assert_failure
assert_output_contains 'Usage: rbenv install'
}
@test "not enough arguments rbenv-uninstall" {
run rbenv-uninstall
assert_failure
assert_output_contains 'Usage: rbenv uninstall'
}
@test "too many arguments for rbenv-uninstall" {
run rbenv-uninstall 2.1.1 2.1.2
assert_failure
assert_output_contains 'Usage: rbenv uninstall'
}