1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/ruby/test_file.rb: add tests for uninitialized object.

* test/ruby/test_class.rb: ditto.

* test/ruby/test_thread.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mame 2008-06-02 12:57:18 +00:00
parent 7eb625425c
commit e58dc6a968
4 changed files with 22 additions and 0 deletions

View file

@ -1,3 +1,11 @@
Mon Jun 2 21:56:47 2008 Yusuke Endoh <mame@tsg.ne.jp>
* test/ruby/test_file.rb: add tests for uninitialized object.
* test/ruby/test_class.rb: ditto.
* test/ruby/test_thread.rb: ditto.
Mon Jun 2 21:44:15 2008 Yusuke Endoh <mame@tsg.ne.jp>
* re.c: fix SEGV by Regexp.allocate.names, Match.allocate.names, etc.

View file

@ -146,4 +146,9 @@ class TestClass < Test::Unit::TestCase
assert_equal(":foo\n:foo\ntrue\ntrue", r.read.chomp)
end
end
def test_uninitialized
assert_raise(TypeError) { Class.allocate.new }
assert_raise(TypeError) { Class.allocate.superclass }
end
end

View file

@ -115,4 +115,7 @@ class TestFile < Test::Unit::TestCase
}
end
def test_uninitialized
assert_raise(TypeError) { File::Stat.allocate.readable? }
end
end

View file

@ -499,4 +499,10 @@ class TestThreadGroup < Test::Unit::TestCase
}.join
t.join
end
def test_uninitialized
c = Class.new(Thread)
c.class_eval { def initialize; end }
assert_raise(ThreadError) { c.new.start }
end
end