def file(path, content=nil, &block)
      raise "file path should be relative the the temporary directory." if path == File.expand_path(path)
      before do
        content = instance_eval(&block) if block
        dest_path = File.join(temp_path, path)
        FileUtils.mkdir_p(File.dirname(dest_path))
        IO.write(dest_path, content)
      end
    end
def file(path, content=nil, &block)
      raise "file path should be relative the the temporary directory." if path == File.expand_path(path)
      before do
        content = instance_eval(&block) if block
        dest_path = File.join(temp_path, path)
        FileUtils.mkdir_p(File.dirname(dest_path))
        IO.write(dest_path, content)
      end
    end
Create a file in the temporary directory for this example.

 @param path [String] Path within the temporary directory to write to.
 @param content [String] File data to write.
 @param block [Proc] Optional block to return file data to write.
 @example
   describe 'myapp' do
     command 'myapp read data.txt'
     file 'data.txt', <<-EOH
   a thing
   EOH
     its(:exitstatus) { is_expected.to eq 0 }
   end