From f86f669cf3242fe825c9b12a4e7b50769f822113 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 6 Aug 2009 04:30:15 +0000 Subject: * test/mkmf/base.rb (TestMkmf): was turned into a class, because MiniUnit doesn't complain even if a testcase has no tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/mkmf/base.rb | 9 ++++++++- test/mkmf/test_sizeof.rb | 6 ++---- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/mkmf/base.rb b/test/mkmf/base.rb index b4cf4884fa..0a75744721 100644 --- a/test/mkmf/base.rb +++ b/test/mkmf/base.rb @@ -9,15 +9,22 @@ RbConfig::CONFIG["cppflags"] << " -I." CONFIG["cppflags"] << " -I." $extout_prefix = "$(extout)$(target_prefix)/" -module TestMkmf +class TestMkmf < Test::Unit::TestCase def setup @tmpdir = Dir.mktmpdir @curdir = Dir.pwd @mkmfobj = Object.new Dir.chdir(@tmpdir) + class << (@output = "") + def flush; end + def reopen(*) end + alias write << + end + $stdout = @output end def teardown + $stdout = STDOUT Dir.chdir(@curdir) FileUtils.rm_rf(@tmpdir) end diff --git a/test/mkmf/test_sizeof.rb b/test/mkmf/test_sizeof.rb index 29a5253418..e1c498dc0a 100644 --- a/test/mkmf/test_sizeof.rb +++ b/test/mkmf/test_sizeof.rb @@ -1,9 +1,7 @@ require_relative 'base' -module TestMkmf - class TestSizeof < Test::Unit::TestCase - include TestMkmf - +class TestMkmf + class TestSizeof < TestMkmf def test_sizeof open("confdefs.h", "w") {|f| f.puts "typedef struct {char x;} test1_t;" -- cgit v1.2.3