nicoquery 0.1.8.8 → 0.1.8.9
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_mapper/video_array.rb +3 -1
- data/lib/nicoquery/version.rb +1 -1
- data/spec/fixture/video_array_no_tags.rb +9 -0
- data/spec/object_mapper/video_array_spec.rb +36 -11
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df91616f6bc69aa2027a406cbf7089798147a752
|
4
|
+
data.tar.gz: c534b11e1fb66304aff2ff15c6b776b2d3bc8fc4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b7128b15c7b6a6dce8e0868fe4e3805076bcf665d0bbb367b40b7dafadbb33eb5fc66bc1c24965a6385f6b3f97211ce4cb6bea5a9e1076addebe1a9b22bea4e
|
7
|
+
data.tar.gz: a6b63aeba94fdd6a95c5c9036af4845f74e91707a896e6494bc3e29293435e854a7fa3f52934da1e85f09d2c870d5181288641ffaf22500fc18c7085b621c509
|
data/Gemfile.lock
CHANGED
data/lib/nicoquery/version.rb
CHANGED
@@ -0,0 +1,9 @@
|
|
1
|
+
module Fixture
|
2
|
+
def self.video_array_no_tags
|
3
|
+
<<-EOS
|
4
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
5
|
+
<nicovideo_video_response status="ok"><count>1</count><video_info><video><id>sm21130836</id><deleted>0</deleted><title>バイオハザードゆっくリベレーションUE裏の1</title><description>本編とは関係ない動画<br />コメント返し(二件)が終わったら残りの時間は雑談になっている動画です mylist/37486541<br />ガンダムとνのバルカン音も入れたのにマシンガンがうるさくて聞こえないね<br />※タグを付けてもらえるのは嬉しいのですがこの裏の動画はタグ無しでお願いします<br /></description><length_in_seconds>488</length_in_seconds><size_low>25940040</size_low><movie_type>mp4</movie_type><thumbnail_url>http://tn-skr1.smilevideo.jp/smile?i=21130836</thumbnail_url><upload_time/><first_retrieve>2013-06-16T19:04:57+09:00</first_retrieve><default_thread>1371377097</default_thread><view_counter>172</view_counter><mylist_counter>3</mylist_counter><option_flag_ichiba>0</option_flag_ichiba><option_flag_community>0</option_flag_community><option_flag_domestic>0</option_flag_domestic><option_flag_comment_type>0</option_flag_comment_type><option_flag_adult>0</option_flag_adult><option_flag_mobile>0</option_flag_mobile><option_flag_economy_mp4>1</option_flag_economy_mp4><option_flag_middle_video>0</option_flag_middle_video><option_flag_mobile_ng_apple>0</option_flag_mobile_ng_apple></video><thread><id>1371377097</id><public>1</public><num_res>13</num_res><community_id/></thread><tags><tag_info/></tags></video_info></nicovideo_video_response>
|
6
|
+
EOS
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
@@ -1,14 +1,16 @@
|
|
1
1
|
require "nicoquery/object_mapper/video_array"
|
2
2
|
require "fixture/video_array_sm20415650_sm9"
|
3
|
+
require "fixture/video_array_no_tags"
|
3
4
|
|
4
5
|
|
5
6
|
describe "NicoQuery::ObjectMapper::VideoArray" do
|
6
|
-
before do
|
7
|
-
xml = Fixture.video_array_sm20415650_sm9
|
8
|
-
@result = NicoQuery::ObjectMapper::VideoArray.new xml
|
9
|
-
end
|
10
7
|
|
11
8
|
context "sm20415650" do
|
9
|
+
before do
|
10
|
+
xml = Fixture.video_array_sm20415650_sm9
|
11
|
+
@result = NicoQuery::ObjectMapper::VideoArray.new xml
|
12
|
+
end
|
13
|
+
|
12
14
|
subject { @result.movies[0] }
|
13
15
|
|
14
16
|
describe "#title" do
|
@@ -83,12 +85,35 @@ describe "NicoQuery::ObjectMapper::VideoArray" do
|
|
83
85
|
end
|
84
86
|
end
|
85
87
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
88
|
+
context "when a movie doesn't contain more than one tag" do
|
89
|
+
before do
|
90
|
+
xml = Fixture.video_array_sm20415650_sm9
|
91
|
+
@result = NicoQuery::ObjectMapper::VideoArray.new xml
|
92
|
+
end
|
93
|
+
|
94
|
+
subject { @result.movies[0] }
|
95
|
+
|
96
|
+
describe "#tags" do
|
97
|
+
it "returns number of mylist references" do
|
98
|
+
expect(subject.tags).to be_a_kind_of Array
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
context "when a movie contains no tag" do
|
104
|
+
before do
|
105
|
+
xml = Fixture.video_array_no_tags
|
106
|
+
@result = NicoQuery::ObjectMapper::VideoArray.new xml
|
107
|
+
end
|
108
|
+
|
109
|
+
subject { @result.movies[0] }
|
110
|
+
|
111
|
+
describe "#tags" do
|
112
|
+
it "returns empty array" do
|
113
|
+
expect(subject.tags).to be_a_kind_of Array
|
114
|
+
expect(subject.tags).to be_empty
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
93
118
|
|
94
119
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masami Yonehara
|
@@ -269,6 +269,7 @@ files:
|
|
269
269
|
- spec/fixture/tag_search_yukkuri_page1.rb
|
270
270
|
- spec/fixture/tag_search_yukkuri_page2.rb
|
271
271
|
- spec/fixture/video_array_community.rb
|
272
|
+
- spec/fixture/video_array_no_tags.rb
|
272
273
|
- spec/fixture/video_array_sm20415650_sm9.rb
|
273
274
|
- spec/nicoquery_spec.rb
|
274
275
|
- spec/object/movie_spec.rb
|
@@ -324,6 +325,7 @@ test_files:
|
|
324
325
|
- spec/fixture/tag_search_yukkuri_page1.rb
|
325
326
|
- spec/fixture/tag_search_yukkuri_page2.rb
|
326
327
|
- spec/fixture/video_array_community.rb
|
328
|
+
- spec/fixture/video_array_no_tags.rb
|
327
329
|
- spec/fixture/video_array_sm20415650_sm9.rb
|
328
330
|
- spec/nicoquery_spec.rb
|
329
331
|
- spec/object/movie_spec.rb
|