From 05e52bf46bfcbfb288ef841008358e04e58ceab4 Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 7 Jan 2008 15:32:07 +0000 Subject: [PATCH] add tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/test_tempfile.rb | 14 ++++++++++++++ test/test_timeout.rb | 13 +++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 test/test_tempfile.rb create mode 100644 test/test_timeout.rb diff --git a/test/test_tempfile.rb b/test/test_tempfile.rb new file mode 100644 index 0000000000..c4234e551d --- /dev/null +++ b/test/test_tempfile.rb @@ -0,0 +1,14 @@ +require 'test/unit' +require 'tempfile' + +class TestTempfile < Test::Unit::TestCase + module M + end + + def test_extend + o = Tempfile.new("foo") + o.extend M + assert(M === o, "[ruby-dev:32932]") + end +end + diff --git a/test/test_timeout.rb b/test/test_timeout.rb new file mode 100644 index 0000000000..dfa863b373 --- /dev/null +++ b/test/test_timeout.rb @@ -0,0 +1,13 @@ +require 'test/unit' +require 'timeout' +require 'thread' + +class TestTimeout < Test::Unit::TestCase + def test_queue + q = Queue.new + assert_raise(Timeout::Error, "[ruby-dev:32935]") { + timeout(0.1) { q.pop } + } + end +end +