mirror of
https://github.com/zunit-zsh/zunit.git
synced 2026-09-10 06:36:15 -04:00
21 lines
532 B
Bash
21 lines
532 B
Bash
#!/usr/bin/env zunit
|
|
|
|
@test 'Test loading script with global variable sets the variable' {
|
|
load ./_support/script-with-global-variable
|
|
|
|
assert "$lost_city" same_as 'Atlantis'
|
|
}
|
|
|
|
@test 'Test loading script with local variable does not set the variable' {
|
|
load ./_support/script-with-local-variable
|
|
|
|
assert "$lost_city" is_empty
|
|
}
|
|
|
|
@test 'Test loading non-existent file throws error' {
|
|
run load ./non-existent-script
|
|
|
|
assert "$state" equals 1
|
|
assert "$output" same_as 'File tests/./non-existent-script does not exist'
|
|
}
|