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 TestClass < Test::Unit::TestCase
|
2011-06-13 07:54:55 +04:00
|
|
|
def setup
|
|
|
|
@engine = YAML::ENGINE.yamler
|
|
|
|
YAML::ENGINE.yamler = 'syck'
|
|
|
|
end
|
|
|
|
|
|
|
|
def teardown
|
|
|
|
YAML::ENGINE.yamler = @engine
|
|
|
|
end
|
|
|
|
|
2009-11-16 20:27:05 +03:00
|
|
|
def test_to_yaml
|
|
|
|
assert_raises(::TypeError) do
|
|
|
|
TestClass.to_yaml
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_dump
|
|
|
|
assert_raises(::TypeError) do
|
|
|
|
YAML.dump TestClass
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|