cram
cram copied to clipboard
Add simple shell variable expansion to the test case output
hi, I have not given this much thought yet but it would probably be nice to have a simple shell expansion in the test case.
For example when tesing a command based on git I have a test case like
$ . ${TESTDIR}/setup
$ my-cmd
Initialized empty Git repository in /tmp/cramtests*/git-wc/.git/ (glob)
while with the available expansion I could have
$ . ${TESTDIR}/setup
$ my-cmd
Initialized empty Git repository in ${GIT_WORK_TREE}/.git/
or possibly
$ . ${TESTDIR}/setup
$ my-cmd
Initialized empty Git repository in ${GIT_WORK_TREE}/.git/ (expand)
note, in this case GIT_WORK_TREE is exported by the ${TESTDIR}/setup command as an input variable for my-cmd
In general I expect this to be helpfull wherever the command output is based on an env variable and supporting only the most basic expansion like ${VAR}, no ${VAR:-foo} etc would go a long way.
how should Cram deal with multiline values?