mirror of
https://github.com/nix-community/nix-direnv.git
synced 2025-11-08 11:36:11 +01:00
This removes python entirely from the stack. Yet to run the tests on macOS, but they're buildable by way of nix wrapping. Worst case scenario, you cannot run them from the devshell but `nix run .#test-runner-<latest||stable>` should work okay.
51 lines
1.2 KiB
Bash
51 lines
1.2 KiB
Bash
# -*- mode: bash-ts -*-
|
|
|
|
function setup {
|
|
load "util"
|
|
|
|
_common_setup
|
|
}
|
|
|
|
function teardown {
|
|
_common_teardown
|
|
}
|
|
|
|
function use_nix_attrs_strict { # @test
|
|
write_envrc "strict_env\nuse nix -A subshell"
|
|
# shellcheck disable=SC2016
|
|
run_in_direnv 'echo "subshell: $THIS_IS_A_SUBSHELL"'
|
|
assert_output -e "subshell: OK$"
|
|
}
|
|
|
|
function use_nix_attrs_no_strict { # @test
|
|
write_envrc "use nix -A subshell"
|
|
# shellcheck disable=SC2016
|
|
run_in_direnv 'echo "subshell: $THIS_IS_A_SUBSHELL"'
|
|
assert_output -e "subshell: OK$"
|
|
}
|
|
|
|
function use_nix_no_nix_path_strict { # @test
|
|
unset NIX_PATH
|
|
write_envrc "strict_env\nuse nix --argstr someArg OK"
|
|
# shellcheck disable=SC2016
|
|
run_in_direnv 'echo "someArg: $SHOULD_BE_SET"'
|
|
assert_output -e "someArg: OK$"
|
|
}
|
|
|
|
function use_nix_no_nix_path_no_strict { # @test
|
|
unset NIX_PATH
|
|
write_envrc "use nix --argstr someArg OK"
|
|
# shellcheck disable=SC2016
|
|
run_in_direnv 'echo "someArg: $SHOULD_BE_SET"'
|
|
assert_output -e "someArg: OK$"
|
|
}
|
|
|
|
function use_nix_no_files { # @test
|
|
write_envrc "use nix -p hello"
|
|
(
|
|
cd "$TESTDIR" || exit 1
|
|
run --separate-stderr direnv status
|
|
assert_success
|
|
refute_output -p 'Loaded watch: "."'
|
|
)
|
|
}
|