From 68e47b61226df183ae17203ae9d0b812f2ce46eb Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 8 Sep 2012 07:54:27 +0000 Subject: 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/rubygems/test_gem_specification.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test') diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb index c0dfd4bafe..1fc9769146 100644 --- a/test/rubygems/test_gem_specification.rb +++ b/test/rubygems/test_gem_specification.rb @@ -117,6 +117,7 @@ end 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 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 @@ end 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 -- cgit v1.2.3