forked from postmodern/chruby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchruby_reset_test.sh
More file actions
executable file
·41 lines (30 loc) · 1.06 KB
/
chruby_reset_test.sh
File metadata and controls
executable file
·41 lines (30 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh
. ./test/helper.sh
setUp()
{
export RUBY_VERSION="$TEST_RUBY_VERSION"
export RUBY_ENGINE="$TEST_RUBY_ENGINE"
export RUBY="/usr/local/$TEST_RUBY_ENGINE-$TEST_RUBY_VERSION-p$TEST_RUBY_PATCHLEVEL"
export GEM_ROOT="$TEST_RUBY/lib/ruby/gems/$TEST_RUBY_API"
export GEM_HOME="$HOME/.gem/$TEST_RUBY_ENGINE/$TEST_RUBY_VERSION"
export PATH="$GEM_HOME/bin:$GEM_ROOT/bin:$RUBY/bin:$TEST_PATH"
chruby_use "$TEST_RUBY"
}
test_chruby_reset()
{
chruby_reset
assertNull "RUBY was not unset" "$RUBY"
assertNull "RUBY_ENGINE was not unset" "$RUBY_ENGINE"
assertNull "RUBY_VERSION was not unset" "$RUBY_VERSION"
assertNull "RUBYOPT was not unset" "$RUBYOPT"
assertNull "GEM_HOME was not unset" "$GEM_HOME"
assertNull "GEM_PATH was not unset" "$GEM_PATH"
assertEquals "PATH was not sanitized" "$TEST_PATH" "$PATH"
}
test_chruby_reset_duplicate_path()
{
export PATH="$PATH:$GEM_HOME/bin:$GEM_ROOT/bin:$RUBY/bin"
chruby_reset
assertEquals "PATH was not sanitized" "$TEST_PATH" "$PATH"
}
SHUNIT_PARENT=$0 . /usr/share/shunit2/shunit2