From a3ace91f3e233a3f7b9db27e20d4496a9e0cfd24 Mon Sep 17 00:00:00 2001 From: naruse Date: Thu, 3 Nov 2011 15:54:16 +0000 Subject: [PATCH] Don't define tests if there is no psych. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/psych/test_yamldbm.rb | 3 ++- test/psych/test_yamlstore.rb | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/psych/test_yamldbm.rb b/test/psych/test_yamldbm.rb index 5fd2d77ed6..1b5d4447b4 100644 --- a/test/psych/test_yamldbm.rb +++ b/test/psych/test_yamldbm.rb @@ -1,6 +1,7 @@ # -*- coding: UTF-8 -*- begin require 'test/unit' + require 'psych' require 'yaml/dbm' require 'tmpdir' rescue LoadError @@ -191,4 +192,4 @@ module Psych assert_equal([], @yamldbm.select {false}) end end -end if defined?(YAML::DBM) +end if defined?(YAML::DBM) && defined?(Psych) diff --git a/test/psych/test_yamlstore.rb b/test/psych/test_yamlstore.rb index d607013ada..c31b33f5ed 100644 --- a/test/psych/test_yamlstore.rb +++ b/test/psych/test_yamlstore.rb @@ -1,10 +1,11 @@ require 'test/unit' +require 'psych' require 'yaml/store' require 'tmpdir' -Psych::Store = YAML::Store unless defined?(Psych::Store) - module Psych + Psych::Store = YAML::Store unless defined?(Psych::Store) + class YAMLStoreTest < Test::Unit::TestCase def setup @engine, YAML::ENGINE.yamler = YAML::ENGINE.yamler, 'psych' @@ -84,4 +85,4 @@ module Psych end end end -end +end if defined?(Psych)