test/psych/visitors/test_to_ruby.rb in psych-1.3.4 vs test/psych/visitors/test_to_ruby.rb in psych-2.0.0

- old
+ new

@@ -1,13 +1,14 @@ +# coding: US-ASCII require 'psych/helper' module Psych module Visitors class TestToRuby < TestCase def setup super - @visitor = ToRuby.new + @visitor = ToRuby.create end def test_object mapping = Nodes::Mapping.new nil, "!ruby/object" mapping.children << Nodes::Scalar.new('foo') @@ -15,12 +16,12 @@ o = mapping.to_ruby assert_equal 'bar', o.instance_variable_get(:@foo) end - def test_awesome - Psych.load('1900-01-01T00:00:00+00:00') + def test_tz_00_00_loads_without_error + assert Psych.load('1900-01-01T00:00:00+00:00') end def test_legacy_struct foo = Struct.new('AWESOME', :bar) assert_equal foo.new('baz'), Psych.load(<<-eoyml) @@ -85,10 +86,10 @@ assert_equal s.foo, mapping.to_ruby.foo end def test_exception - exc = Exception.new 'hello' + exc = ::Exception.new 'hello' mapping = Nodes::Mapping.new nil, '!ruby/exception' mapping.children << Nodes::Scalar.new('message') mapping.children << Nodes::Scalar.new('hello')