test/test_protocol.rb in atom-tools-0.9.4 vs test/test_protocol.rb in atom-tools-1.0.0

- old
+ new

@@ -41,18 +41,18 @@ ws = service.workspaces.first assert_equal "My Blog", ws.title.to_s coll = ws.collections.first - assert_equal URI.parse("http://example.org/myblog/entries"), coll.uri - assert_equal "Entries", coll.title.to_s - assert_equal "entry", coll.accepts + assert_equal URI.parse("http://example.org/myblog/entries"), coll.uri + assert_equal "Entries", coll.title.to_s + assert_equal ["application/atom+xml;type=entry"], coll.accepts coll = ws.collections.last - assert_equal URI.parse("http://example.org/myblog/fotes"), coll.uri - assert_equal "Photos", coll.title.to_s - assert_equal "image/*", coll.accepts + assert_equal URI.parse("http://example.org/myblog/fotes"), coll.uri + assert_equal "Photos", coll.title.to_s + assert_equal ["image/*"], coll.accepts http = service.instance_variable_get(:@http) assert_instance_of Atom::HTTP, http # collections should inherit the service's HTTP object @@ -72,11 +72,11 @@ coll.title = "Entries" ws.collections << coll coll = Atom::Collection.new "http://example.org/audio" coll.title = "Audio" - coll.accepts = "audio/*" + coll.accepts = ["audio/*"] ws.collections << coll nses = { "app" => Atom::PP_NS, "atom" => Atom::NS } doc = REXML::Document.new(service.to_s) @@ -100,20 +100,20 @@ assert_equal "http://example.org/entries", entries.attributes["href"] title = REXML::XPath.first(entries, "./atom:title", nses) assert_equal "Entries", title.text - accepts = REXML::XPath.first(entries, "./app:accepts", nses) + accepts = REXML::XPath.first(entries, "./app:accept", nses) assert_nil accepts audio = colls.last assert_equal "http://example.org/audio", audio.attributes["href"] title = REXML::XPath.first(audio, "./atom:title", nses) assert_equal "Audio", title.text - accepts = REXML::XPath.first(audio, "./app:accepts", nses) + accepts = REXML::XPath.first(audio, "./app:accept", nses) assert_equal "audio/*", accepts.text end def test_dont_specify_http_object collection = Atom::Collection.new("http://necronomicorp.com/testatom?atom")