hapijs/inert — pull request #8 by kanongil (2014-10-27 15:53:57+00:00)
Title: Use open file descriptors to retain file between prepare and marshal phases

WIP patch to fix #4, including new & updated tests.

This patch seems to work as is, and passes all test on my machine. However, it doesn't have 100% code coverage due to never triggering the `Fs.fstat()` error response. Given that this is only likely to trigger on messed up filesystems with an `EIO` error, I'm at a loss on how to test for this. Perhaps some kind of mocking?

I also have concerns about forgetting open file descriptors. I do ensure that they are closed whenever `finish` is triggered on the response but I found no such hooks for error'ed responses, which is needed for this to work. Am I missing something?