[前][次][番号順一覧][スレッド一覧]

ruby-changes:12704

From: nobu <ko1@a...>
Date: Thu, 6 Aug 2009 13:30:27 +0900 (JST)
Subject: [ruby-changes:12704] Ruby:r24420 (trunk): * test/mkmf/base.rb (TestMkmf): was turned into a class, because

nobu	2009-08-06 13:30:15 +0900 (Thu, 06 Aug 2009)

  New Revision: 24420

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24420

  Log:
    * test/mkmf/base.rb (TestMkmf): was turned into a class, because
      MiniUnit doesn't complain even if a testcase has no tests.

  Modified files:
    trunk/test/mkmf/base.rb
    trunk/test/mkmf/test_sizeof.rb

Index: test/mkmf/test_sizeof.rb
===================================================================
--- test/mkmf/test_sizeof.rb	(revision 24419)
+++ test/mkmf/test_sizeof.rb	(revision 24420)
@@ -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;"
Index: test/mkmf/base.rb
===================================================================
--- test/mkmf/base.rb	(revision 24419)
+++ test/mkmf/base.rb	(revision 24420)
@@ -9,15 +9,22 @@
 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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]