test/test_xml.rb in atom-tools-0.9.0 vs test/test_xml.rb in atom-tools-0.9.1

- old
+ new

@@ -1,9 +1,9 @@ require "test/unit" # for entry.edit_url -require "atom/app" +require "atom/service" class AtomTest < Test::Unit::TestCase def test_text_type_text entry = get_entry @@ -283,9 +283,23 @@ entry = Atom::Entry.parse xml assert_equal "http://necronomicorp.com/nil", entry.content["src"] assert_equal "", entry.content.to_s + end + + def test_serialize_base + entry = Atom::Entry.new + + entry.base = "http://necronomicorp.com/nil" + + base = get_elements(entry).root.attributes["xml:base"] + assert_equal "http://necronomicorp.com/nil", base + + entry.base = URI.parse("http://necronomicorp.com/nil") + + base = get_elements(entry).root.attributes["xml:base"] + assert_equal "http://necronomicorp.com/nil", base end def test_relative_base base_url = "http://www.tbray.org/ongoing/ongoing.atom" doc = "<entry xmlns='http://www.w3.org/2005/Atom' xml:base='When/200x/2006/10/11/'/>"