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

ruby-changes:24870

From: nobu <ko1@a...>
Date: Sat, 8 Sep 2012 16:54:41 +0900 (JST)
Subject: [ruby-changes:24870] nobu:r36921 (trunk): test_gem_specification.rb: skip meaningless tests

nobu	2012-09-08 16:54:27 +0900 (Sat, 08 Sep 2012)

  New Revision: 36921

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

  Log:
    test_gem_specification.rb: skip meaningless tests
    
    * test/rubygems/test_gem_specification.rb (have_syck): skip tests
      which are meaningless if syck is never possible.

  Modified files:
    trunk/test/rubygems/test_gem_specification.rb

Index: test/rubygems/test_gem_specification.rb
===================================================================
--- test/rubygems/test_gem_specification.rb	(revision 36920)
+++ test/rubygems/test_gem_specification.rb	(revision 36921)
@@ -117,6 +117,7 @@
   end
 
   def test_self_from_yaml_syck_date_bug
+    return unless have_syck     # No meanings if no syck
     # This is equivalent to (and totally valid) psych 1.0 output and
     # causes parse errors on syck.
     yaml = @a1.to_yaml
@@ -131,6 +132,7 @@
   end
 
   def test_self_from_yaml_syck_default_key_bug
+    return unless have_syck     # No meanings if no syck
     # This is equivalent to (and totally valid) psych 1.0 output and
     # causes parse errors on syck.
     yaml = <<-YAML
@@ -1729,4 +1731,16 @@
   ensure
     $VERBOSE = old_verbose
   end
+
+  def have_syck
+    unless defined?(@@have_syck)
+      begin
+        old_verbose, $VERBOSE = $VERBOSE, nil
+        @@have_syck = with_syck {YAML::ENGINE.syck?}
+      ensure
+        $VERBOSE = old_verbose
+      end
+    end
+    @@have_syck
+  end
 end

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

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