ruby-changes:21575
From: naruse <ko1@a...>
Date: Fri, 4 Nov 2011 00:54:27 +0900 (JST)
Subject: [ruby-changes:21575] naruse:r33624 (trunk): Don't define tests if there is no psych.
naruse 2011-11-04 00:54:16 +0900 (Fri, 04 Nov 2011) New Revision: 33624 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33624 Log: Don't define tests if there is no psych. Modified files: trunk/test/psych/test_yamldbm.rb trunk/test/psych/test_yamlstore.rb Index: test/psych/test_yamlstore.rb =================================================================== --- test/psych/test_yamlstore.rb (revision 33623) +++ test/psych/test_yamlstore.rb (revision 33624) @@ -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) -module Psych class YAMLStoreTest < Test::Unit::TestCase def setup @engine, YAML::ENGINE.yamler = YAML::ENGINE.yamler, 'psych' @@ -84,4 +85,4 @@ end end end -end +end if defined?(Psych) Index: test/psych/test_yamldbm.rb =================================================================== --- test/psych/test_yamldbm.rb (revision 33623) +++ test/psych/test_yamldbm.rb (revision 33624) @@ -1,6 +1,7 @@ # -*- coding: UTF-8 -*- begin require 'test/unit' + require 'psych' require 'yaml/dbm' require 'tmpdir' rescue LoadError @@ -191,4 +192,4 @@ assert_equal([], @yamldbm.select {false}) end end -end if defined?(YAML::DBM) +end if defined?(YAML::DBM) && defined?(Psych) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/