spec/timelog4r_spec.rb in timelog4r-0.1.0 vs spec/timelog4r_spec.rb in timelog4r-0.1.1
- old
+ new
@@ -52,10 +52,11 @@
<link href="http://a.com" />
<modified>200201220122</modified>
<fromid>b</fromid>
<fromname>b</fromname>' +
@dummy_author_b +
+ '<star>2</star>' +
'</entry>'
@dummy_entry_c = '
<entry>
<id>c</id>
<memo>c</memo>
@@ -66,10 +67,11 @@
<toname>a</toname>
<replyid>a</replyid>
<link href="http://a.com" />
<modified>200201220122</modified>' +
@dummy_author_a +
+ '<star>0</star>' +
'</entry>'
@dummy_timeline = '
<memos>
<title>hoge</title>
<link href="http://hoge.com/" />
@@ -213,10 +215,28 @@
it 'successful should be a kind of Hash' do
@accessor.get_friends_timeline.should be_a_kind_of(Hash)
end
end
+ describe ' when get memo clip' do
+ before do
+ doc = REXML::Document.new(@dummy_timeline)
+ @accessor.user_id = 'dummy'
+ @accessor.password = 'dummy'
+ @accessor.should_receive(:http_access).once.and_return(doc)
+ end
+
+ it 'successful should be a kind of Hash' do
+ @accessor.get_memo_clip.should be_a_kind_of(Hash)
+ end
+
+ after do
+ @accessor.user_id = nil
+ @accessor.password = nil
+ end
+ end
+
describe ' when get tag list' do
before do
doc = REXML::Document.new(@dummy_tag_list)
@accessor.user_id = 'dummy'
@accessor.password = 'dummy'
@@ -277,9 +297,27 @@
@accessor.should_receive(:http_access).once.and_return(doc)
end
it 'success should be a kind of Hash' do
@accessor.get_fan_list.should be_a_kind_of(Hash)
+ end
+
+ after do
+ @accessor.user_id = nil
+ @accessor.password = nil
+ end
+ end
+
+ describe ' when get memofriend list' do
+ before do
+ doc = REXML::Document.new(@dummy_user_list)
+ @accessor.user_id = 'dummy'
+ @accessor.password = 'dummy'
+ @accessor.should_receive(:http_access).once.and_return(doc)
+ end
+
+ it 'success should be a kind of Hash' do
+ @accessor.get_memofriend_list.should be_a_kind_of(Hash)
end
after do
@accessor.user_id = nil
@accessor.password = nil