From 477ab69f10337f63500ac340a00c9cb1b8fab596 Mon Sep 17 00:00:00 2001 From: Anil Wadghule Date: Wed, 19 May 2010 16:25:21 +0530 Subject: [PATCH] Fix xml serialization test [#4650 state:resolved] --- .../serializeration/xml_serialization_test.rb | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/activemodel/test/cases/serializeration/xml_serialization_test.rb b/activemodel/test/cases/serializeration/xml_serialization_test.rb index 7b9ef3e..ff78665 100644 --- a/activemodel/test/cases/serializeration/xml_serialization_test.rb +++ b/activemodel/test/cases/serializeration/xml_serialization_test.rb @@ -17,6 +17,9 @@ module Admin end end +class Customer < Struct.new(:name) +end + class XmlSerializationTest < ActiveModel::TestCase def setup @contact = Contact.new @@ -24,7 +27,7 @@ class XmlSerializationTest < ActiveModel::TestCase @contact.age = 25 @contact.created_at = Time.utc(2006, 8, 1) @contact.awesome = false - customer = OpenStruct.new + customer = Customer.new customer.name = "John" @contact.preferences = customer end @@ -104,7 +107,7 @@ class XmlSerializationTest < ActiveModel::TestCase end test "should serialize yaml" do - assert_match %r{--- !ruby/object:OpenStruct \ntable:\s*:name: John\n}, @contact.to_xml + assert_match %r{--- !ruby/struct:Customer \nname: John\n}, @contact.to_xml end test "should call proc on object" do -- 1.6.6.1