buildpack-stdlib
buildpack-stdlib copied to clipboard
Problems with the set_env tests
- The same test is repeated twice:
@test "results of set_env" {
set_env hello world
result1="$(cat $PROFILE_PATH)"
result2="$(cat $EXPORT_PATH)"
[ "$result1" = "export hello=world" ]
[ "$result2" = "export hello=world" ]
}
@test "results of set_env" {
set_env hello world
result1="$(cat $PROFILE_PATH)"
result2="$(cat $EXPORT_PATH)"
[ "$result1" = "export hello=world" ]
[ "$result2" = "export hello=world" ]
}
-
The bats tests
setup()method sets hello world manually itself, which overlaps with the tests. This seems like it would obscureset_envnot working in the test itself. -
There should probably be a few more tests to (a) ensure that later calls of
set_envdon't overwrite the earlier profile script, (b) make sure environment variable values with spaces are supported (and similar edge cases).