[前][次][番号順一覧][スレッド一覧]

ruby-changes:15403

From: tenderlove <ko1@a...>
Date: Sun, 11 Apr 2010 10:45:24 +0900 (JST)
Subject: [ruby-changes:15403] Ruby:r27296 (trunk): * test/syck/test_struct.rb: modified to use only syck engine since the

tenderlove	2010-04-11 10:45:15 +0900 (Sun, 11 Apr 2010)

  New Revision: 27296

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=27296

  Log:
    * test/syck/test_struct.rb: modified to use only syck engine since the
      YAML is invalid.
    * test/syck/test_yaml.rb: ditto
    * test/syck/test_yamlstore.rb: modifications for multi-engine
      environment.

  Modified files:
    trunk/test/syck/test_struct.rb
    trunk/test/syck/test_yaml.rb
    trunk/test/syck/test_yamlstore.rb

Index: test/syck/test_yamlstore.rb
===================================================================
--- test/syck/test_yamlstore.rb	(revision 27295)
+++ test/syck/test_yamlstore.rb	(revision 27296)
@@ -1,9 +1,9 @@
 require 'test/unit'
-require 'yaml/store'
 
 module Syck
   class YAMLStoreTest < Test::Unit::TestCase
     def setup
+      require 'yaml/store'
       @yamlstore_file = "yamlstore.tmp.#{Process.pid}"
       @yamlstore = YAML::Store.new(@yamlstore_file)
     end
Index: test/syck/test_yaml.rb
===================================================================
--- test/syck/test_yaml.rb	(revision 27295)
+++ test/syck/test_yaml.rb	(revision 27296)
@@ -13,6 +13,15 @@
 
 module Syck
 class YAML_Unit_Tests < Test::Unit::TestCase
+    def setup
+        @current_engine = YAML::ENGINE.yamler
+        YAML::ENGINE.yamler = 'syck'
+    end
+
+    def teardown
+        YAML::ENGINE.yamler = @current_engine
+    end
+
 	#
 	# Convert between YAML and the object to verify correct parsing and
 	# emitting
Index: test/syck/test_struct.rb
===================================================================
--- test/syck/test_struct.rb	(revision 27295)
+++ test/syck/test_struct.rb	(revision 27296)
@@ -11,6 +11,15 @@
 
 module Syck
   class TestStruct < MiniTest::Unit::TestCase
+    def setup
+        @current_engine = YAML::ENGINE.yamler
+        YAML::ENGINE.yamler = 'syck'
+    end
+
+    def teardown
+        YAML::ENGINE.yamler = @current_engine
+    end
+
     def test_roundtrip
       thing = StructWithIvar.new('bar')
       struct = YAML.load(YAML.dump(thing))
@@ -24,7 +33,7 @@
 --- !ruby/struct:StructWithIvar 
 foo: bar
 @bar: hello
-      eoyml
+eoyml
 
       assert_equal 'hello', obj.bar
       assert_equal 'bar', obj.foo

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]