require File.join(File.dirname(__FILE__), '..', 'test_helper') class TestXmlArray < Test::Unit::TestCase def test_as_array_with_auto_guard result = BookWithContributors.from_xml(%{ David Thomas Andrew Hunt Chad Fowler }).contributors.map(&:name).sort assert_equal ["David Thomas","Andrew Hunt","Chad Fowler"].sort, result end end