diff options
author | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-11 01:45:15 +0000 |
---|---|---|
committer | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-11 01:45:15 +0000 |
commit | f3668748149f814f29c2a32a91914672ee966699 (patch) | |
tree | e357df4d4c8eb9a3fad82075a95ebd95779312c0 | |
parent | ff5366a7053a2d420139e32fb3936ee85a2839fe (diff) |
* 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.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/syck/test_struct.rb | 11 | ||||
-rw-r--r-- | test/syck/test_yaml.rb | 9 | ||||
-rw-r--r-- | test/syck/test_yamlstore.rb | 2 |
3 files changed, 20 insertions, 2 deletions
diff --git a/test/syck/test_struct.rb b/test/syck/test_struct.rb index cdd4814fd4..547c5f2d71 100644 --- a/test/syck/test_struct.rb +++ b/test/syck/test_struct.rb @@ -11,6 +11,15 @@ end 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 @@ module Syck --- !ruby/struct:StructWithIvar foo: bar @bar: hello - eoyml +eoyml assert_equal 'hello', obj.bar assert_equal 'bar', obj.foo diff --git a/test/syck/test_yaml.rb b/test/syck/test_yaml.rb index ece1b768e3..1a78e9d216 100644 --- a/test/syck/test_yaml.rb +++ b/test/syck/test_yaml.rb @@ -13,6 +13,15 @@ end 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 diff --git a/test/syck/test_yamlstore.rb b/test/syck/test_yamlstore.rb index 971c75bf27..c94a745ac1 100644 --- a/test/syck/test_yamlstore.rb +++ b/test/syck/test_yamlstore.rb @@ -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 |