From 0fb1a905c6c3a1cd47ea3462084ac54c1cf52a89 Mon Sep 17 00:00:00 2001 From: akr Date: Wed, 27 Aug 2008 15:09:47 +0000 Subject: * io.c (rb_io_initialize): don't accept IO object. [ruby-dev:35895] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18883 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_io.rb | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'test/ruby') diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index de1a1526e..6b2dc3102 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -1189,31 +1189,6 @@ class TestIO < Test::Unit::TestCase assert_equal("foo\nbar\nbaz\n", File.read(t.path)) - with_pipe do |r, w| - assert_raise(RuntimeError) do - o = Object.new - class << o; self; end.instance_eval do - define_method(:to_io) { r } - end - w.instance_eval { initialize(o) } - end - end - - pipe(proc do |w| - w = IO.new(w) - w.puts "foo" - w.puts "bar" - w.puts "baz" - w.close - end, proc do |r| - r = IO.new(r) - assert_equal("foo\nbar\nbaz\n", r.read) - end) - - with_pipe do |r, w| - assert_raise(ArgumentError) { IO.new(r, "r+") } - end - f = open(t.path) assert_raise(RuntimeError) do f.instance_eval { initialize } -- cgit