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:
parent
ff5366a705
commit
f366874814
3 changed files with 20 additions and 2 deletions
|
@ -11,6 +11,15 @@ end
|
||||||
|
|
||||||
module Syck
|
module Syck
|
||||||
class TestStruct < MiniTest::Unit::TestCase
|
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
|
def test_roundtrip
|
||||||
thing = StructWithIvar.new('bar')
|
thing = StructWithIvar.new('bar')
|
||||||
struct = YAML.load(YAML.dump(thing))
|
struct = YAML.load(YAML.dump(thing))
|
||||||
|
@ -24,7 +33,7 @@ module Syck
|
||||||
--- !ruby/struct:StructWithIvar
|
--- !ruby/struct:StructWithIvar
|
||||||
foo: bar
|
foo: bar
|
||||||
@bar: hello
|
@bar: hello
|
||||||
eoyml
|
eoyml
|
||||||
|
|
||||||
assert_equal 'hello', obj.bar
|
assert_equal 'hello', obj.bar
|
||||||
assert_equal 'bar', obj.foo
|
assert_equal 'bar', obj.foo
|
||||||
|
|
|
@ -13,6 +13,15 @@ end
|
||||||
|
|
||||||
module Syck
|
module Syck
|
||||||
class YAML_Unit_Tests < Test::Unit::TestCase
|
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
|
# Convert between YAML and the object to verify correct parsing and
|
||||||
# emitting
|
# emitting
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
require 'test/unit'
|
require 'test/unit'
|
||||||
require 'yaml/store'
|
|
||||||
|
|
||||||
module Syck
|
module Syck
|
||||||
class YAMLStoreTest < Test::Unit::TestCase
|
class YAMLStoreTest < Test::Unit::TestCase
|
||||||
def setup
|
def setup
|
||||||
|
require 'yaml/store'
|
||||||
@yamlstore_file = "yamlstore.tmp.#{Process.pid}"
|
@yamlstore_file = "yamlstore.tmp.#{Process.pid}"
|
||||||
@yamlstore = YAML::Store.new(@yamlstore_file)
|
@yamlstore = YAML::Store.new(@yamlstore_file)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue