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
b7237690
Commit
b7237690
authored
Jul 19, 2015
by
Erik Michaels-Ober
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #766 from jasonkarns/remove-sed-fallback
remove sed fallback for help/usage
parents
67886c84
5013fa8b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
8 deletions
+28
-8
bin/rbenv-install
+1
-2
bin/rbenv-uninstall
+1
-2
test/rbenv.bats
+26
-4
No files found.
bin/rbenv-install
View file @
b7237690
...
@@ -46,8 +46,7 @@ fi
...
@@ -46,8 +46,7 @@ fi
eval
"
$(
ruby-build
--lib
)
"
eval
"
$(
ruby-build
--lib
)
"
usage
()
{
usage
()
{
# We can remove the sed fallback once rbenv 0.4.0 is widely available.
rbenv-help install 2>/dev/null
rbenv-help install 2>/dev/null
||
sed
-ne
'/^#/!q;s/.//;s/.//;1,4d;p'
<
"
$0
"
[
-z
"
$1
"
]
||
exit
"
$1
"
[
-z
"
$1
"
]
||
exit
"
$1
"
}
}
...
...
bin/rbenv-uninstall
View file @
b7237690
...
@@ -18,8 +18,7 @@ if [ "$1" = "--complete" ]; then
...
@@ -18,8 +18,7 @@ if [ "$1" = "--complete" ]; then
fi
fi
usage
()
{
usage
()
{
# We can remove the sed fallback once rbenv 0.4.0 is widely available.
rbenv-help uninstall 2>/dev/null
rbenv-help uninstall 2>/dev/null
||
sed
-ne
'/^#/!q;s/.//;s/.//;1,4d;p'
<
"
$0
"
[
-z
"
$1
"
]
||
exit
"
$1
"
[
-z
"
$1
"
]
||
exit
"
$1
"
}
}
...
...
test/rbenv.bats
View file @
b7237690
...
@@ -149,39 +149,61 @@ OUT
...
@@ -149,39 +149,61 @@ OUT
@test "not enough arguments for rbenv-install" {
@test "not enough arguments for rbenv-install" {
stub_ruby_build
stub_ruby_build
stub rbenv-help 'install : true'
run rbenv-install
run rbenv-install
assert_failure
assert_failure
assert_output_contains 'Usage: rbenv install'
unstub rbenv-help
}
}
@test "too many arguments for rbenv-install" {
@test "too many arguments for rbenv-install" {
stub_ruby_build
stub_ruby_build
stub rbenv-help 'install : true'
run rbenv-install 2.1.1 2.1.2
run rbenv-install 2.1.1 2.1.2
assert_failure
assert_failure
assert_output_contains 'Usage: rbenv install'
unstub rbenv-help
}
}
@test "show help for rbenv-install" {
@test "show help for rbenv-install" {
stub_ruby_build
stub_ruby_build
stub rbenv-help 'install : true'
run rbenv-install -h
run rbenv-install -h
assert_success
assert_success
unstub rbenv-help
}
@test "rbenv-install has usage help preface" {
run head "$(which rbenv-install)"
assert_output_contains 'Usage: rbenv install'
assert_output_contains 'Usage: rbenv install'
}
}
@test "not enough arguments rbenv-uninstall" {
@test "not enough arguments rbenv-uninstall" {
stub rbenv-help 'uninstall : true'
run rbenv-uninstall
run rbenv-uninstall
assert_failure
assert_failure
assert_output_contains 'Usage: rbenv uninstall'
unstub rbenv-help
}
}
@test "too many arguments for rbenv-uninstall" {
@test "too many arguments for rbenv-uninstall" {
stub rbenv-help 'uninstall : true'
run rbenv-uninstall 2.1.1 2.1.2
run rbenv-uninstall 2.1.1 2.1.2
assert_failure
assert_failure
assert_output_contains 'Usage: rbenv uninstall'
unstub rbenv-help
}
}
@test "show help for rbenv-uninstall" {
@test "show help for rbenv-uninstall" {
stub rbenv-help 'uninstall : true'
run rbenv-uninstall -h
run rbenv-uninstall -h
assert_success
assert_success
unstub rbenv-help
}
@test "rbenv-uninstall has usage help preface" {
run head "$(which rbenv-uninstall)"
assert_output_contains 'Usage: rbenv uninstall'
assert_output_contains 'Usage: rbenv uninstall'
}
}
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