summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-09-08 07:54:27 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-09-08 07:54:27 +0000
commit68e47b61226df183ae17203ae9d0b812f2ce46eb (patch)
treeb047a822b51e8fe0fcb7a10ef006467c8a4c1111 /test
parent9dd9041fcfa4335f748a0ce9424ddd1af9343cff (diff)
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
Diffstat (limited to 'test')
-rw-r--r--test/rubygems/test_gem_specification.rb14
1 files changed, 14 insertions, 0 deletions
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