nicoquery 0.1.8 → 0.1.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/nicoquery/object/movie.rb +3 -0
- data/lib/nicoquery/object_mapper/getthumbinfo.rb +42 -3
- data/lib/nicoquery/version.rb +1 -1
- data/spec/fixture/mylist_normal.rb +162 -0
- data/spec/fixture/mylist_rss_normal.rb +46 -0
- data/spec/nicoquery_spec.rb +9 -1
- data/spec/object/movie_spec.rb +29 -28
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 257a555fc2ff54f1a2aac6d77f082bd721673bf2
|
4
|
+
data.tar.gz: 846851b83bc6d951732b4d4a9a8682e8add0642f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1d6f6a337cf6bb77352c41aeb57629b9b04da68b7c826234709269295b7dc606acdac824e73ca609739e3bfa2e2aaa77e936ac026a69ed0fe843c0e33eaf022
|
7
|
+
data.tar.gz: 0b035dfa767af9d09b10504f9c70dae4b383ddabebff820e463813ec74e7e93ee4599f583fefc5d1c884fe285f2197ec593d7657a2bdac06cff551875231d150
|
data/Gemfile.lock
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
require "nicoquery/api/getthumbinfo"
|
2
|
+
require "nicoquery/api/video_array"
|
2
3
|
require "nicoquery/object_mapper/getthumbinfo"
|
4
|
+
require "nicoquery/object_mapper/video_array"
|
3
5
|
|
4
6
|
|
5
7
|
module NicoQuery
|
@@ -24,6 +26,7 @@ module NicoQuery
|
|
24
26
|
@source[:video_array].presence ||
|
25
27
|
@source[:getthumbinfo].presence ||
|
26
28
|
Proc.new { get_and_set_getthumbinfo_source; @source[:getthumbinfo] }.call
|
29
|
+
|
27
30
|
source.send field_name
|
28
31
|
end
|
29
32
|
end
|
@@ -9,7 +9,11 @@ module NicoQuery
|
|
9
9
|
@xml = xml
|
10
10
|
@parser = Nori.new
|
11
11
|
@parsed_xml = @parser.parse xml
|
12
|
+
|
12
13
|
@hash = @parsed_xml['nicovideo_thumb_response']['thumb']
|
14
|
+
if !exist?
|
15
|
+
@hash = @parser.parse null_xml
|
16
|
+
end
|
13
17
|
end
|
14
18
|
|
15
19
|
def deleted?
|
@@ -32,7 +36,7 @@ module NicoQuery
|
|
32
36
|
if @parsed_xml['nicovideo_thumb_response']["error"].presence
|
33
37
|
@parsed_xml['nicovideo_thumb_response']["error"].presence["code"].presence != "NOT_FOUND"
|
34
38
|
else
|
35
|
-
|
39
|
+
true
|
36
40
|
end
|
37
41
|
end
|
38
42
|
|
@@ -86,7 +90,7 @@ module NicoQuery
|
|
86
90
|
end
|
87
91
|
|
88
92
|
def view_counter
|
89
|
-
return nil if @hash
|
93
|
+
return nil if @hash.nil? || @hash['view_counter'].nil?
|
90
94
|
@hash['view_counter'].to_i
|
91
95
|
end
|
92
96
|
|
@@ -131,7 +135,7 @@ module NicoQuery
|
|
131
135
|
end
|
132
136
|
|
133
137
|
def tags
|
134
|
-
return nil if @hash
|
138
|
+
return nil if @hash.nil? || @hash['tags'].nil?
|
135
139
|
xml = @xml.scan(/\<tags domain=\"jp\">\n.+\n\<\/tags\>/m)[0]
|
136
140
|
parsed = Nokogiri::XML xml
|
137
141
|
parsed.xpath("//tag").map do |tag_object|
|
@@ -156,6 +160,41 @@ module NicoQuery
|
|
156
160
|
|
157
161
|
{ text: text, lock: lock }
|
158
162
|
end
|
163
|
+
|
164
|
+
def null_xml
|
165
|
+
<<-EOS
|
166
|
+
<video_id></video_id>
|
167
|
+
<title></title>
|
168
|
+
<description></description>
|
169
|
+
<thumbnail_url></thumbnail_url>
|
170
|
+
<first_retrieve></first_retrieve>
|
171
|
+
<length></length>
|
172
|
+
<movie_type></movie_type>
|
173
|
+
<size_high></size_high>
|
174
|
+
<size_low></size_low>
|
175
|
+
<view_counter></view_counter>
|
176
|
+
<comment_num></comment_num>
|
177
|
+
<mylist_counter></mylist_counter>
|
178
|
+
<last_res_body></last_res_body>
|
179
|
+
<watch_url></watch_url>
|
180
|
+
<thumb_type></thumb_type>
|
181
|
+
<embeddable></embeddable>
|
182
|
+
<no_live_play></no_live_play>
|
183
|
+
<tags domain="jp">
|
184
|
+
<tag></tag>
|
185
|
+
<tag></tag>
|
186
|
+
<tag></tag>
|
187
|
+
<tag></tag>
|
188
|
+
<tag></tag>
|
189
|
+
<tag></tag>
|
190
|
+
<tag></tag>
|
191
|
+
<tag></tag>
|
192
|
+
<tag></tag>
|
193
|
+
<tag></tag>
|
194
|
+
</tags>
|
195
|
+
<user_id></user_id>
|
196
|
+
EOS
|
197
|
+
end
|
159
198
|
end
|
160
199
|
end
|
161
200
|
end
|
data/lib/nicoquery/version.rb
CHANGED
@@ -0,0 +1,162 @@
|
|
1
|
+
module Fixture
|
2
|
+
def self.video_array_sm20415650_sm9
|
3
|
+
<<-EOS
|
4
|
+
<nicovideo_video_response status="ok">
|
5
|
+
<count>2</count>
|
6
|
+
<video_info>
|
7
|
+
<video>
|
8
|
+
<id>sm20415650</id>
|
9
|
+
<deleted>0</deleted>
|
10
|
+
<title>【Minecraft】まったりクラフター生活 ~最終日~【ゆっくり実況】</title>
|
11
|
+
<description>最終日。<br /><br />ひっそりまったり通常営業...かな?<br />ついにきました最終日。最後に最長の尺...画質が悪いかもです><<br />今まで本当にありがとうございました!最後にゆっくりまったりしていってね(*´ヮ`*)<br /><br />シード値:-2086770116<br /><br />使用MOD<br />1.Opti Fine<br />2.MinecraftIM<br />3.PlayerFormLittleMaid<br />4.Audiotori r2<br />5.littleMaidMob<br />+りばいあ製MOD×2(らいちんぐすてっき・ゆかり&らいちロボ)<br /><br />sm20221817←29日目⇔新シリーズ→sm21615389<br /><br />シリーズまとめ→mylist/29017292<br />他に作ったもの→mylist/29022355<br /><br />twitter⇒http://twitter.com/raichi_J<br />コミュco1590050<br /><br />いただいたイラストclip/577830<br />ゆかりテクスチャim2807664<br />moyuさん作・ゆかりさんと私のメイドモデルim2466837</description>
|
12
|
+
<length_in_seconds>1469</length_in_seconds>
|
13
|
+
<size_low>77315257</size_low>
|
14
|
+
<movie_type>mp4</movie_type>
|
15
|
+
<thumbnail_url>http://tn-skr3.smilevideo.jp/smile?i=20415650</thumbnail_url>
|
16
|
+
<upload_time/>
|
17
|
+
<first_retrieve>2013-03-23T23:10:32+09:00</first_retrieve>
|
18
|
+
<default_thread>1364047834</default_thread>
|
19
|
+
<view_counter>27330</view_counter>
|
20
|
+
<mylist_counter>701</mylist_counter>
|
21
|
+
<option_flag_ichiba>0</option_flag_ichiba>
|
22
|
+
<option_flag_community>0</option_flag_community>
|
23
|
+
<option_flag_domestic>0</option_flag_domestic>
|
24
|
+
<option_flag_comment_type>0</option_flag_comment_type>
|
25
|
+
<option_flag_adult>0</option_flag_adult>
|
26
|
+
<option_flag_mobile>0</option_flag_mobile>
|
27
|
+
<option_flag_economy_mp4>1</option_flag_economy_mp4>
|
28
|
+
<option_flag_middle_video>0</option_flag_middle_video>
|
29
|
+
<option_flag_mobile_ng_apple>0</option_flag_mobile_ng_apple>
|
30
|
+
</video>
|
31
|
+
<thread>
|
32
|
+
<id>1364047834</id>
|
33
|
+
<public>1</public>
|
34
|
+
<num_res>2221</num_res>
|
35
|
+
<community_id/>
|
36
|
+
</thread>
|
37
|
+
<tags>
|
38
|
+
<tag_info>
|
39
|
+
<tag>ゲーム</tag>
|
40
|
+
<area>jp</area>
|
41
|
+
</tag_info>
|
42
|
+
<tag_info>
|
43
|
+
<tag>Minecraft</tag>
|
44
|
+
<area>jp</area>
|
45
|
+
</tag_info>
|
46
|
+
<tag_info>
|
47
|
+
<tag>ゆっくり実況プレイ</tag>
|
48
|
+
<area>jp</area>
|
49
|
+
</tag_info>
|
50
|
+
<tag_info>
|
51
|
+
<tag>VOICEROID+_結月ゆかり</tag>
|
52
|
+
<area>jp</area>
|
53
|
+
</tag_info>
|
54
|
+
<tag_info>
|
55
|
+
<tag>VOICEROID+_民安ともえ</tag>
|
56
|
+
<area>jp</area>
|
57
|
+
</tag_info>
|
58
|
+
<tag_info>
|
59
|
+
<tag>らいち♪</tag>
|
60
|
+
<area>jp</area>
|
61
|
+
</tag_info>
|
62
|
+
<tag_info>
|
63
|
+
<tag>ゆっくり実況プレイ最終回リンク</tag>
|
64
|
+
<area>jp</area>
|
65
|
+
</tag_info>
|
66
|
+
<tag_info>
|
67
|
+
<tag>ゆかりお母さん</tag>
|
68
|
+
<area>jp</area>
|
69
|
+
</tag_info>
|
70
|
+
<tag_info>
|
71
|
+
<tag>納得の感動</tag>
|
72
|
+
<area>jp</area>
|
73
|
+
</tag_info>
|
74
|
+
<tag_info>
|
75
|
+
<tag>ラストを飾る壮大なうっかり</tag>
|
76
|
+
<area>jp</area>
|
77
|
+
</tag_info>
|
78
|
+
<tag_info>
|
79
|
+
<tag>ゆかりさんの中の人巡回済み</tag>
|
80
|
+
<area>jp</area>
|
81
|
+
</tag_info>
|
82
|
+
</tags>
|
83
|
+
</video_info>
|
84
|
+
|
85
|
+
<video_info>
|
86
|
+
<video>
|
87
|
+
<id>sm9</id>
|
88
|
+
<deleted>0</deleted>
|
89
|
+
<title>新・豪血寺一族 -煩悩解放 - レッツゴー!陰陽師</title>
|
90
|
+
<description>レッツゴー!陰陽師(フルコーラスバージョン)</description>
|
91
|
+
<length_in_seconds>319</length_in_seconds>
|
92
|
+
<size_low>17436492</size_low>
|
93
|
+
<movie_type>flv</movie_type>
|
94
|
+
<thumbnail_url>http://tn-skr2.smilevideo.jp/smile?i=9</thumbnail_url>
|
95
|
+
<upload_time/>
|
96
|
+
<first_retrieve>2007-03-06T00:33:00+09:00</first_retrieve>
|
97
|
+
<default_thread>1173108780</default_thread>
|
98
|
+
<view_counter>13645663</view_counter>
|
99
|
+
<mylist_counter>134447</mylist_counter>
|
100
|
+
<option_flag_ichiba>0</option_flag_ichiba>
|
101
|
+
<option_flag_community>0</option_flag_community>
|
102
|
+
<option_flag_domestic>0</option_flag_domestic>
|
103
|
+
<option_flag_comment_type>0</option_flag_comment_type>
|
104
|
+
<option_flag_adult>0</option_flag_adult>
|
105
|
+
<option_flag_mobile>0</option_flag_mobile>
|
106
|
+
<option_flag_economy_mp4>1</option_flag_economy_mp4>
|
107
|
+
<option_flag_middle_video>0</option_flag_middle_video>
|
108
|
+
<option_flag_mobile_ng_apple>0</option_flag_mobile_ng_apple>
|
109
|
+
</video>
|
110
|
+
<thread>
|
111
|
+
<id>1173108780</id>
|
112
|
+
<public>1</public>
|
113
|
+
<num_res>4159811</num_res>
|
114
|
+
<community_id/>
|
115
|
+
</thread>
|
116
|
+
<tags>
|
117
|
+
<tag_info>
|
118
|
+
<tag>陰陽師</tag>
|
119
|
+
<area>jp</area>
|
120
|
+
</tag_info>
|
121
|
+
<tag_info>
|
122
|
+
<tag>レッツゴー!陰陽師</tag>
|
123
|
+
<area>jp</area>
|
124
|
+
</tag_info>
|
125
|
+
<tag_info>
|
126
|
+
<tag>公式</tag>
|
127
|
+
<area>jp</area>
|
128
|
+
</tag_info>
|
129
|
+
<tag_info>
|
130
|
+
<tag>音楽</tag>
|
131
|
+
<area>jp</area>
|
132
|
+
</tag_info>
|
133
|
+
<tag_info>
|
134
|
+
<tag>ゲーム</tag>
|
135
|
+
<area>jp</area>
|
136
|
+
</tag_info>
|
137
|
+
<tag_info>
|
138
|
+
<tag>最古の動画</tag>
|
139
|
+
<area>jp</area>
|
140
|
+
</tag_info>
|
141
|
+
<tag_info>
|
142
|
+
<tag>新・豪血寺一族</tag>
|
143
|
+
<area>jp</area>
|
144
|
+
</tag_info>
|
145
|
+
<tag_info>
|
146
|
+
<tag>元気の出る動画</tag>
|
147
|
+
<area>jp</area>
|
148
|
+
</tag_info>
|
149
|
+
<tag_info>
|
150
|
+
<tag>3月6日投稿動画</tag>
|
151
|
+
<area>jp</area>
|
152
|
+
</tag_info>
|
153
|
+
<tag_info>
|
154
|
+
<tag>sm9</tag>
|
155
|
+
<area>jp</area>
|
156
|
+
</tag_info>
|
157
|
+
</tags>
|
158
|
+
</video_info>
|
159
|
+
</nicovideo_video_response>
|
160
|
+
EOS
|
161
|
+
end
|
162
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module Fixture
|
2
|
+
def self.mylist_rss_normal
|
3
|
+
<<-EOS
|
4
|
+
<?xml version="1.0" encoding="utf-8"?>
|
5
|
+
<rss version="2.0"
|
6
|
+
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
7
|
+
xmlns:atom="http://www.w3.org/2005/Atom">
|
8
|
+
|
9
|
+
<channel>
|
10
|
+
|
11
|
+
<title>マイリスト to_test‐ニコニコ動画</title>
|
12
|
+
<link>http://www.nicovideo.jp/mylist/38369702</link>
|
13
|
+
<atom:link rel="self" type="application/rss+xml" href="http://www.nicovideo.jp/mylist/38369702?numbers=1&rss=2.0"/>
|
14
|
+
<description>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam cursus. Morbi ut mi. Nullam enim leo, egestas id, condimentum at, laoreet mattis, massa. Sed eleifend nonummy diam. Praesent mauris ante, elementum et, bibendum at, posuere sit amet, nibh. Duis </description>
|
15
|
+
<pubDate>Sun, 18 Aug 2013 18:34:27 +0900</pubDate>
|
16
|
+
<lastBuildDate>Sun, 18 Aug 2013 18:34:27 +0900</lastBuildDate>
|
17
|
+
<generator>ニコニコ動画</generator>
|
18
|
+
<dc:creator>うえおに</dc:creator>
|
19
|
+
<language>ja-jp</language>
|
20
|
+
<copyright>(c) niwango, inc. All rights reserved.</copyright>
|
21
|
+
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
|
22
|
+
|
23
|
+
|
24
|
+
<item>
|
25
|
+
<title>【初音ミク】みくみくにしてあげる♪【してやんよ】</title>
|
26
|
+
<link>http://www.nicovideo.jp/watch/sm1097445</link>
|
27
|
+
<guid isPermaLink="false">tag:nicovideo.jp,2007-09-20:/watch/1190218917</guid>
|
28
|
+
<pubDate>Sat, 17 Aug 2013 22:54:20 +0900</pubDate>
|
29
|
+
<description><![CDATA[<p class="nico-thumbnail"><img alt="【初音ミク】みくみくにしてあげる♪【してやんよ】" src="http://tn-skr2.smilevideo.jp/smile?i=1097445" width="94" height="70" border="0"/></p><p class="nico-description">おまえら、みっくみくにしてやんよ。歌詞はhttp://ikamo.hp.infoseek.co.jp/mikumiku.txt(9/20 1:55修正)。上げている他のもの→mylist/1450136</p><p class="nico-info"><small><strong class="nico-info-length">1:38</strong>|<strong class="nico-info-date">2007年09月20日 01:22:02</strong> 投稿</small></p><p class="nico-numbers"><small>再生:<strong class="nico-numbers-view">10,736,618</strong>  コメント:<strong class="nico-numbers-res">2,733,080</strong>  マイリスト:<strong class="nico-numbers-mylist">210,503</strong></small></p>]]></description>
|
30
|
+
</item>
|
31
|
+
|
32
|
+
<item>
|
33
|
+
<title>新・豪血寺一族 -煩悩解放 - レッツゴー!陰陽師</title>
|
34
|
+
<link>http://www.nicovideo.jp/watch/sm9</link>
|
35
|
+
<guid isPermaLink="false">tag:nicovideo.jp,2007-03-06:/watch/1173108780</guid>
|
36
|
+
<pubDate>Sat, 17 Aug 2013 22:52:21 +0900</pubDate>
|
37
|
+
<description><![CDATA[<p class="nico-thumbnail"><img alt="新・豪血寺一族 -煩悩解放 - レッツゴー!陰陽師" src="http://tn-skr2.smilevideo.jp/smile?i=9" width="94" height="70" border="0"/></p><p class="nico-description">レッツゴー!陰陽師(フルコーラスバージョン)</p><p class="nico-info"><small><strong class="nico-info-length">5:19</strong>|<strong class="nico-info-date">2007年03月06日 00:33:00</strong> 投稿</small></p><p class="nico-numbers"><small>再生:<strong class="nico-numbers-view">13,658,762</strong>  コメント:<strong class="nico-numbers-res">4,161,059</strong>  マイリスト:<strong class="nico-numbers-mylist">134,549</strong></small></p>]]></description>
|
38
|
+
</item>
|
39
|
+
|
40
|
+
</channel>
|
41
|
+
|
42
|
+
</rss>
|
43
|
+
|
44
|
+
EOS
|
45
|
+
end
|
46
|
+
end
|
data/spec/nicoquery_spec.rb
CHANGED
@@ -1,11 +1,15 @@
|
|
1
1
|
require "nicoquery"
|
2
2
|
require "pry"
|
3
|
+
require "fixture/mylist_rss_normal"
|
3
4
|
|
4
5
|
|
5
6
|
describe "NicoQuery" do
|
6
7
|
# TODO: object/mylist_spec.rbのコピペなのでDRYに。
|
7
8
|
describe "mylist" do
|
8
9
|
before do
|
10
|
+
WebMock.stub_request(:get, "http://www.nicovideo.jp/mylist/38369702?numbers=1&rss=2.0").
|
11
|
+
with(:headers => {'Accept'=>'*/*; q=0.5, application/xml', 'Accept-Encoding'=>'gzip, deflate', 'User-Agent'=>'Ruby'}).
|
12
|
+
to_return(:status => 200, :body => Fixture.mylist_rss_normal, :headers => {})
|
9
13
|
# mylist:38369702 はテスト用に作ったマイリスト。以下の動画を含んでいる。
|
10
14
|
# sm9 新・豪血寺一族 -煩悩解放 - レッツゴー!陰陽師
|
11
15
|
# sm1097445 【初音ミク】みくみくにしてあげる♪【してやんよ】
|
@@ -98,7 +102,11 @@ describe "NicoQuery" do
|
|
98
102
|
|
99
103
|
context "when passed an string array of video id to argument" do
|
100
104
|
before do
|
101
|
-
|
105
|
+
WebMock.stub_request(:get, "http://i.nicovideo.jp/v3/video.array?v=sm20415650,sm9").
|
106
|
+
with(:headers => {'Accept'=>'*/*; q=0.5, application/xml', 'Accept-Encoding'=>'gzip, deflate', 'User-Agent'=>'Ruby'}).
|
107
|
+
to_return(:status => 200, :body => "", :headers => {})
|
108
|
+
|
109
|
+
@movie = NicoQuery.movie(['sm20415650', 'sm9'])
|
102
110
|
end
|
103
111
|
|
104
112
|
subject { @movie }
|
data/spec/object/movie_spec.rb
CHANGED
@@ -3,16 +3,21 @@ require 'fixture/getthumbinfo_deleted'
|
|
3
3
|
require 'fixture/getthumbinfo_community'
|
4
4
|
require 'fixture/video_array_community'
|
5
5
|
require 'fixture/getthumbinfo_notfound'
|
6
|
+
require 'fixture/getthumbinfo_sm20415650'
|
6
7
|
require 'webmock/rspec'
|
7
8
|
|
8
9
|
|
9
10
|
describe "NicoQuery::Object::Movie" do
|
10
11
|
context "when specified video id and this movie is exist" do
|
11
12
|
before do
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
@movie = NicoQuery::Object::Movie.new('
|
13
|
+
WebMock.enable!
|
14
|
+
WebMock.stub_request(:get, "http://ext.nicovideo.jp/api/getthumbinfo/sm20415650?").
|
15
|
+
to_return(:status => 200, :body => Fixture.getthumbinfo_sm20415650, :headers => {})
|
16
|
+
@movie = NicoQuery::Object::Movie.new('sm20415650')
|
17
|
+
end
|
18
|
+
|
19
|
+
after do
|
20
|
+
WebMock.disable!
|
16
21
|
end
|
17
22
|
|
18
23
|
subject { @movie }
|
@@ -25,19 +30,19 @@ describe "NicoQuery::Object::Movie" do
|
|
25
30
|
|
26
31
|
describe "title" do
|
27
32
|
it "returns string of title" do
|
28
|
-
expect(subject.title).to eq "
|
33
|
+
expect(subject.title).to eq "【Minecraft】まったりクラフター生活 ~最終日~【ゆっくり実況】"
|
29
34
|
end
|
30
35
|
end
|
31
36
|
|
32
37
|
describe "url" do
|
33
38
|
it "returns string of url" do
|
34
|
-
expect(subject.url).to eq "http://www.nicovideo.jp/watch/
|
39
|
+
expect(subject.url).to eq "http://www.nicovideo.jp/watch/sm20415650"
|
35
40
|
end
|
36
41
|
end
|
37
42
|
|
38
43
|
describe "video_id" do
|
39
44
|
it "returns number of mylist_id" do
|
40
|
-
expect(subject.video_id).to eq "
|
45
|
+
expect(subject.video_id).to eq "sm20415650"
|
41
46
|
end
|
42
47
|
end
|
43
48
|
|
@@ -57,25 +62,25 @@ describe "NicoQuery::Object::Movie" do
|
|
57
62
|
end
|
58
63
|
|
59
64
|
specify "each object has text and lock key-value" do
|
60
|
-
expect(subject).to include(text: '
|
65
|
+
expect(subject).to include(text: 'Minecraft', lock: true)
|
61
66
|
end
|
62
67
|
end
|
63
68
|
end
|
64
69
|
|
65
|
-
context "when specified thread id and this movie is exist" do
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
+
# context "when specified thread id and this movie is exist" do
|
71
|
+
# before do
|
72
|
+
# # thread_id:1173108780 == video_id:sm9
|
73
|
+
# @movie = NicoQuery::Object::Movie.new(1173108780)
|
74
|
+
# end
|
70
75
|
|
71
|
-
|
76
|
+
# subject { @movie }
|
72
77
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
end
|
78
|
+
# describe "title" do
|
79
|
+
# it "returns string of title" do
|
80
|
+
# expect(subject.title).to eq "新・豪血寺一族 -煩悩解放 - レッツゴー!陰陽師"
|
81
|
+
# end
|
82
|
+
# end
|
83
|
+
# end
|
79
84
|
|
80
85
|
context "when specified movie is deleted" do
|
81
86
|
before do
|
@@ -135,14 +140,10 @@ describe "NicoQuery::Object::Movie" do
|
|
135
140
|
end
|
136
141
|
end
|
137
142
|
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
expect(subject.view_counter).to be_nil
|
143
|
-
expect(subject.tags).to be_nil
|
144
|
-
end
|
145
|
-
end
|
143
|
+
specify { expect(subject.title).to be_nil }
|
144
|
+
specify { expect(subject.url).to be_nil }
|
145
|
+
specify { expect(subject.view_counter).to be_nil }
|
146
|
+
specify { expect(subject.tags).to be_nil }
|
146
147
|
end
|
147
148
|
|
148
149
|
context "when specified movie doesn't exist" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nicoquery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.8
|
4
|
+
version: 0.1.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masami Yonehara
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -258,8 +258,10 @@ files:
|
|
258
258
|
- spec/fixture/getthumbinfo_deleted.rb
|
259
259
|
- spec/fixture/getthumbinfo_notfound.rb
|
260
260
|
- spec/fixture/getthumbinfo_sm20415650.rb
|
261
|
+
- spec/fixture/mylist_normal.rb
|
261
262
|
- spec/fixture/mylist_rss_18266317.rb
|
262
263
|
- spec/fixture/mylist_rss_403.rb
|
264
|
+
- spec/fixture/mylist_rss_normal.rb
|
263
265
|
- spec/fixture/tag_search.rb
|
264
266
|
- spec/fixture/tag_search_403.rb
|
265
267
|
- spec/fixture/tag_search_item.rb
|
@@ -311,8 +313,10 @@ test_files:
|
|
311
313
|
- spec/fixture/getthumbinfo_deleted.rb
|
312
314
|
- spec/fixture/getthumbinfo_notfound.rb
|
313
315
|
- spec/fixture/getthumbinfo_sm20415650.rb
|
316
|
+
- spec/fixture/mylist_normal.rb
|
314
317
|
- spec/fixture/mylist_rss_18266317.rb
|
315
318
|
- spec/fixture/mylist_rss_403.rb
|
319
|
+
- spec/fixture/mylist_rss_normal.rb
|
316
320
|
- spec/fixture/tag_search.rb
|
317
321
|
- spec/fixture/tag_search_403.rb
|
318
322
|
- spec/fixture/tag_search_item.rb
|