aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/mkmf/base.rb9
-rw-r--r--test/mkmf/test_sizeof.rb6
2 files changed, 10 insertions, 5 deletions
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;"