2009-11-16 12:27:05 -05:00
|
|
|
require 'test/unit'
|
|
|
|
require 'yaml'
|
|
|
|
|
2010-04-10 20:37:42 -04:00
|
|
|
module Syck
|
2009-11-16 12:27:05 -05:00
|
|
|
class TestArray < Test::Unit::TestCase
|
|
|
|
def setup
|
2011-12-12 03:30:24 -05:00
|
|
|
@current_engine = YAML::ENGINE.yamler
|
|
|
|
YAML::ENGINE.yamler = 'syck'
|
2009-11-16 12:27:05 -05:00
|
|
|
@list = [{ :a => 'b' }, 'foo']
|
|
|
|
end
|
|
|
|
|
2011-12-12 03:30:24 -05:00
|
|
|
def teardown
|
|
|
|
YAML::ENGINE.yamler = @current_engine
|
|
|
|
end
|
|
|
|
|
2009-11-16 12:27:05 -05: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
|