Commit 85a01065 by Tester

assert that rbenv-install/uninstall scripts have usage section preface

parent f2f77388
......@@ -12,6 +12,11 @@ stub_ruby_build() {
stub ruby-build "--lib : $BATS_TEST_DIRNAME/../bin/ruby-build --lib" "$@"
}
extract_usage_from() {
local program="../bin/$1"
sed -ne '/^#/!q;s/.//;s/.//;1,4d;p' < "$program"
}
@test "install proper" {
stub_ruby_build 'echo ruby-build "$@"'
......@@ -180,6 +185,11 @@ OUT
unstub rbenv-help
}
@test "rbenv-install has usage help preface" {
run extract_usage_from rbenv-install
assert_output_contains 'Usage: rbenv install'
}
@test "not enough arguments rbenv-uninstall" {
stub rbenv-help 'uninstall : echo "Usage: rbenv uninstall"'
......@@ -209,3 +219,8 @@ OUT
unstub rbenv-help
}
@test "rbenv-uninstall has usage help preface" {
run extract_usage_from rbenv-uninstall
assert_output_contains 'Usage: rbenv uninstall'
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment