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
2d2eef70
Commit
2d2eef70
authored
Jun 10, 2016
by
Yamashita, Yuu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove `aria2c` from PATH to use `curl` stub during test
parent
e56f6cf8
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
0 deletions
+38
-0
test/build.bats
+1
-0
test/cache.bats
+1
-0
test/fetch.bats
+1
-0
test/hooks.bats
+1
-0
test/rbenv.bats
+1
-0
test/test_helper.bash
+33
-0
No files found.
test/build.bats
View file @
2d2eef70
...
...
@@ -8,6 +8,7 @@ export CC=cc
export -n RUBY_CONFIGURE_OPTS
setup() {
ensure_not_found_in_path aria2c
mkdir -p "$INSTALL_ROOT"
stub md5 false
stub aria2c false
...
...
test/cache.bats
View file @
2d2eef70
...
...
@@ -6,6 +6,7 @@ export RUBY_BUILD_CACHE_PATH="$TMP/cache"
export RUBY_BUILD_ARIA2_OPTS=
setup() {
ensure_not_found_in_path aria2c
mkdir "$RUBY_BUILD_CACHE_PATH"
}
...
...
test/fetch.bats
View file @
2d2eef70
...
...
@@ -5,6 +5,7 @@ export RUBY_BUILD_SKIP_MIRROR=1
export RUBY_BUILD_CACHE_PATH=
setup() {
ensure_not_found_in_path aria2c
export RUBY_BUILD_BUILD_PATH="${TMP}/source"
mkdir -p "${RUBY_BUILD_BUILD_PATH}"
}
...
...
test/hooks.bats
View file @
2d2eef70
...
...
@@ -3,6 +3,7 @@
load test_helper
setup() {
ensure_not_found_in_path aria2c
export RBENV_ROOT="${TMP}/rbenv"
export HOOK_PATH="${TMP}/i has hooks"
mkdir -p "$HOOK_PATH"
...
...
test/rbenv.bats
View file @
2d2eef70
...
...
@@ -4,6 +4,7 @@ load test_helper
export RBENV_ROOT="${TMP}/rbenv"
setup() {
ensure_not_found_in_path aria2c
stub rbenv-hooks 'install : true'
stub rbenv-rehash 'true'
}
...
...
test/test_helper.bash
View file @
2d2eef70
...
...
@@ -9,6 +9,39 @@ if [ "$FIXTURE_ROOT" != "$BATS_TEST_DIRNAME/fixtures" ]; then
export
PATH
fi
remove_command_from_path
()
{
OLDIFS
=
"
${
IFS
}
"
local
cmd
=
"
$1
"
local
path
local
paths
=()
IFS
=
:
for
path
in
${
PATH
}
;
do
if
[
-e
"
${
path
}
/
${
cmd
}
"
]
;
then
local
tmp_path
=
"
$(
mktemp
-d
"
${
TMP
}
/path.XXXXX"
)
"
ln
-fs
"
${
path
}
"
/
*
"
${
tmp_path
}
"
rm
-f
"
${
tmp_path
}
/
${
cmd
}
"
paths[
"
${#
paths
[@]
}
"
]=
"
${
tmp_path
}
"
else
paths[
"
${#
paths
[@]
}
"
]=
"
${
path
}
"
fi
done
export
PATH
=
"
${
paths
[*]
}
"
IFS
=
"
${
OLDIFS
}
"
}
ensure_not_found_in_path
()
{
local
cmd
for
cmd
;
do
if
command
-v
"
${
cmd
}
"
1>/dev/null 2>&1
;
then
remove_command_from_path
"
${
cmd
}
"
fi
done
}
setup
()
{
ensure_not_found_in_path aria2c
}
teardown
()
{
rm
-fr
"
${
TMP
:?
}
"
/
*
}
...
...
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