1
2
3
4
5
6
7
8
9
10
11
  it "raises EOFError on loading an empty file" do
    temp_file = "marshal.rubinius.tmp.#{Process.pid}"
    File.new(temp_file, "w").close
    begin
      file = File.new(temp_file, "r")
      lambda { puts "foo" }.should raise_error(EOFError)
    ensure
      file.close rescue nil
      File.unlink(temp_file) rescue nil
    end
  end