mirror of
https://github.com/NixOS/nix
synced 2025-07-07 06:01:48 +02:00
Adds nix-shell
test for special-cased ruby interpreter.
The test fakes the interpreter only to verify the arguments it would be given.
This commit is contained in:
parent
399f43c3d5
commit
9478f88681
3 changed files with 23 additions and 0 deletions
|
@ -39,3 +39,12 @@ chmod a+rx $TEST_ROOT/shell.shebang.sh
|
|||
|
||||
output=$($TEST_ROOT/shell.shebang.sh abc def)
|
||||
[ "$output" = "foo bar abc def" ]
|
||||
|
||||
# Test nix-shell shebang mode for ruby
|
||||
# This uses a fake interpreter that returns the arguments passed
|
||||
# This, in turn, verifies the `rc` script is valid and the `load()` script (given using `-e`) is as expected.
|
||||
sed -e "s|@ENV_PROG@|$(type -p env)|" shell.shebang.rb > $TEST_ROOT/shell.shebang.rb
|
||||
chmod a+rx $TEST_ROOT/shell.shebang.rb
|
||||
|
||||
output=$($TEST_ROOT/shell.shebang.rb abc ruby)
|
||||
[ "$output" = '-e load("'"$TEST_ROOT"'/shell.shebang.rb") -- abc ruby' ]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue