Skip to content

shpec should use proper 'temp' files #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
hlangeveld opened this issue May 14, 2015 · 1 comment
Open

shpec should use proper 'temp' files #84

hlangeveld opened this issue May 14, 2015 · 1 comment

Comments

@hlangeveld
Copy link
Collaborator

Currently, the default tests for shpec in shpec_shpec.sh use hardcoded temporary files.
This can cause strange effects on systems where these filenames have been used before, whether by the same user or by others.

Example: /tmp/syntax_error_output

What we need is a couple of helper functions and hooks to create proper temporary files (using the external mktemp(1) on linux systems.

When we create tempfiles, we can add them to a ${_shpec_temp_files} list so we can remove them in end().

Wanders of pondering on storing filename with indent_level...

@nwmcsween
Copy link

mktemp isn't POSIX, see: https://github.com/nwmcsween/shrimp/blob/master/file.sh for a portable way of doing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants