Add missing require statements for tempfile #467
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When pdfkit is used in an rspec test run using the rspec binary, the
tests pass even with the missing require for tempfile, because rspec
is bringing in tempfile. But running pdfkit outside of a test
environment, in a project that is not already bringing in tempfile,
will fail.
The test for this is:
Which results in a stack trace including:
I don't know how to make a good test for this in rspec, since rspec hides the problem by bringing in the missing library. I guess the test could shell out to a little test file like the one above, but I don't know if that's worth the trouble.