From a30fd3b6604237ef112412928a9c077886415854 Mon Sep 17 00:00:00 2001 From: ktsj Date: Sun, 9 Oct 2011 02:18:18 +0000 Subject: * test/psych/test_yamldbm.rb: don't run test if the system don't support yaml/dbm. * test/syck/test_yamldbm.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/psych/test_yamldbm.rb | 14 +++++++++----- test/syck/test_yamldbm.rb | 14 +++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) (limited to 'test') diff --git a/test/psych/test_yamldbm.rb b/test/psych/test_yamldbm.rb index 165125f65e..c60a18febe 100644 --- a/test/psych/test_yamldbm.rb +++ b/test/psych/test_yamldbm.rb @@ -1,10 +1,14 @@ # -*- coding: UTF-8 -*- -require 'test/unit' -require 'yaml/dbm' -require 'tmpdir' -Psych::DBM = YAML::DBM unless defined?(Psych::DBM) +begin + require 'test/unit' + require 'yaml/dbm' + require 'tmpdir' +rescue LoadError +end module Psych + ::Psych::DBM = ::YAML::DBM unless defined?(::Psych::DBM) + class YAMLDBMTest < Test::Unit::TestCase def setup @engine, YAML::ENGINE.yamler = YAML::ENGINE.yamler, 'psych' @@ -187,4 +191,4 @@ module Psych assert_equal([], @yamldbm.select {false}) end end -end +end if defined?(YAML::DBM) diff --git a/test/syck/test_yamldbm.rb b/test/syck/test_yamldbm.rb index f017dd090d..a4a3afb66a 100644 --- a/test/syck/test_yamldbm.rb +++ b/test/syck/test_yamldbm.rb @@ -1,10 +1,14 @@ # -*- coding: UTF-8 -*- -require 'test/unit' -require 'yaml/dbm' -require 'tmpdir' -Syck::DBM = YAML::DBM unless defined?(Syck::DBM) +begin + require 'test/unit' + require 'yaml/dbm' + require 'tmpdir' +rescue LoadError +end module Syck + ::Syck::DBM = ::YAML::DBM unless defined?(::Syck::DBM) + class YAMLDBMTest < Test::Unit::TestCase def setup @engine, YAML::ENGINE.yamler = YAML::ENGINE.yamler, 'syck' @@ -187,4 +191,4 @@ module Syck assert_equal([], @yamldbm.select {false}) end end -end +end if defined?(YAML::DBM) -- cgit v1.2.3