OSDN Git Service

no comments
[lbw/ldblogwriter2.git] / test / test-atom_response.rb
1 $LOAD_PATH.unshift '../lib'
2
3 require 'test/unit'
4 require 'ldblogwriter/atom_response.rb'
5 require 'ldblogwriter/config.rb'
6
7 class TestAtomResponse < Test::Unit::TestCase
8   def setup
9     @test_xml =<<EOF
10 <?xml version="1.0" encoding="UTF-8"?>
11 <entry xmlns="http://purl.org/atom/ns#">
12 <title>test</title>
13   <link rel="alternate" type="text/html" href="http://blog.livedoor.jp/bulknews/archives/00618.html"/>
14   <link rel="service.edit" type="application/x.atom+xml" href="http://blog.livedoor.com/atom/blog_id=17/entry_id=618" title="test"/>
15   <modified>2004-01-14T11:43:49Z</modified>
16   <issued>2003-12-25T23:47:44+09:00</issued>
17   <id>tag:blog.livedoor.jp,:bulknews.618</id>
18   <summary type="text/plain">tetsts</summary>
19   <subject/>
20 <content type="text/html" mode="escaped" xml:lang="ja" xml:base="http://blog.livedoor.jp/bulknews/archives/00618.html">
21 <![CDATA[tets]]>
22 </content>
23 <author><name>bulknews</name></author>
24 </entry>
25 EOF
26   end
27
28   # AtomResponse.uriは最初のURIを返す。
29   def test_uri
30     atom_response = LDBlogWriter::AtomResponse.new(@test_xml)
31     assert_equal('http://blog.livedoor.jp/bulknews/archives/00618.html', atom_response.uri)
32   end
33
34   def test_title
35     atom_response = LDBlogWriter::AtomResponse.new(@test_xml)
36     assert_equal('test', atom_response.title)
37   end
38 end