[macruby-changes] [MacRuby/MacRuby] cc4016: IO#reopen will raise an exception when receiver or...

noreply at github.com noreply at github.com
Thu May 12 16:43:48 PDT 2011


Branch: refs/heads/master
Home:   https://github.com/MacRuby/MacRuby

Commit: cc4016504a68173aa97fbcb3b9abd0ecd121ff16
    https://github.com/MacRuby/MacRuby/commit/cc4016504a68173aa97fbcb3b9abd0ecd121ff16
Author: Watson <watson1978 at gmail.com>
Date:   2011-05-12 (Thu, 12 May 2011)

Changed paths:
  M io.c

Log Message:
-----------
IO#reopen will raise an exception when receiver or passed IO object was frozen.

Test Script:
{{{
require 'test/unit/assertions.rb'
include Test::Unit::Assertions

File.delete("/tmp/foo") if File.exists?("/tmp/foo")

r, w = IO.pipe
w.freeze

path = "/tmp/bar"
assert_raise(RuntimeError){ w.reopen(path, "w") }

f = File.open("/tmp/foo", "w")
assert_raise(RuntimeError){ w.reopen(f) }

f.freeze
assert_raise(RuntimeError){ r.reopen(f) }

puts :ok
}}}




More information about the macruby-changes mailing list