Skip to content

Commit b14b94b

Browse files
FranklinYupostmodern
authored andcommitted
Back up the "$LANG" and restore after test
1 parent a02d25d commit b14b94b

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

test/unit/chruby_reset_test.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ function test_chruby_reset_hash_table()
1515
assertEquals "did not clear the path table" \
1616
"" "$(hash)"
1717
elif [[ -n "$BASH_VERSION" ]]; then
18+
local old_lang="$LANG"
1819
export LANG=en_US.UTF-8
1920
chruby_reset
2021

2122
assertEquals "did not clear the path table" \
2223
"hash: hash table empty" "$(hash)"
2324

24-
unset LANG
25+
LANG="$old_lang"
2526
fi
2627
}
2728

test/unit/chruby_use_test.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ function test_chruby_clears_hash_table()
88
assertEquals "did not clear the path table" \
99
"" "$(hash)"
1010
elif [[ -n "$BASH_VERSION" ]]; then
11+
local old_lang="$LANG"
1112
export LANG=en_US.UTF-8
1213
chruby_use "$test_ruby_root" >/dev/null
1314

1415
assertEquals "did not clear the path table" \
1516
"hash: hash table empty" "$(hash)"
1617

17-
unset LANG
18+
LANG="$old_lang"
1819
fi
1920
}
2021

0 commit comments

Comments
 (0)