2009-11-16 20:27:05 +03:00
|
|
|
require 'test/unit'
|
|
|
|
require 'yaml'
|
|
|
|
|
2010-04-11 04:37:42 +04:00
|
|
|
module Syck
|
2009-11-16 20:27:05 +03:00
|
|
|
class TestArray < Test::Unit::TestCase
|
|
|
|
def setup
|
2011-12-12 12:30:24 +04:00
|
|
|
@current_engine = YAML::ENGINE.yamler
|
|
|
|
YAML::ENGINE.yamler = 'syck'
|
2009-11-16 20:27:05 +03:00
|
|
|
@list = [{ :a => 'b' }, 'foo']
|
|
|
|
end
|
|
|
|
|
2011-12-12 12:30:24 +04:00
|
|
|
def teardown
|
|
|
|
YAML::ENGINE.yamler = @current_engine
|
|
|
|
end
|
|
|
|
|
2009-11-16 20:27:05 +03:00
|
|
|
def test_to_yaml
|
|
|
|
assert_equal @list, YAML.load(@list.to_yaml)
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_dump
|
|
|
|
assert_equal @list, YAML.load(YAML.dump(@list))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|