[MacRuby/MacRuby] 53eefd: IO.for_fd raises an Errno::EINVAL if passed mode i...
Branch: refs/heads/master Home: https://github.com/MacRuby/MacRuby Commit: 53eefd3a5bd0dcf30e0e1cabab869a29a37aa0e5 https://github.com/MacRuby/MacRuby/commit/53eefd3a5bd0dcf30e0e1cabab869a29a3... Author: Watson <watson1978@gmail.com> Date: 2012-02-14 (Tue, 14 Feb 2012) Changed paths: M io.c Log Message: ----------- IO.for_fd raises an Errno::EINVAL if passed mode is not compatible with fd's current mode Test Script: ---- require 'test/unit/assertions.rb' include Test::Unit::Assertions fd = IO.sysopen("/tmp/aaa.txt", "w") assert_raise(Errno::EINVAL){ io = IO.for_fd(fd, "r") } fd = IO.sysopen("/tmp/aaa.txt", "w") assert_raise(Errno::EINVAL){ io = IO.for_fd(fd, "w+") } fd = IO.sysopen("/tmp/aaa.txt", "w") assert_nothing_raised{ io = IO.for_fd(fd, "a") }
participants (1)
-
GitHub