the tempfile is simply a quick way of creating a unique filename in the tmp directory.  This file is then used to capture output from the running rspec process similar to the call to open(...) which captures the string output in an 'output' variable.  I had to move away from using the open(...) call to launch the command because open doesn't honor detached subprocesses whereas Process.spawn does (though unfortunately it appears that jruby doesn't fully support it)