1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
tenderlove 2010-04-11 01:45:15 +00:00
parent ff5366a705
commit f366874814
3 changed files with 20 additions and 2 deletions

View file

@ -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

View file

@ -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

View file

@ -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