summaryrefslogtreecommitdiff
path: root/test/syck/test_array.rb
blob: 59c9f469ce33c0ee04c5b469927b069ba4aba6ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require 'test/unit'
require 'yaml'

module Syck
  class TestArray < Test::Unit::TestCase
    def setup
      @current_engine = YAML::ENGINE.yamler
      YAML::ENGINE.yamler = 'syck'
      @list = [{ :a => 'b' }, 'foo']
    end

    def teardown
      YAML::ENGINE.yamler = @current_engine
    end

    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