video_info 2.3.1 → 2.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/lib/video_info/providers/vimeo.rb +1 -1
  4. data/lib/video_info/version.rb +1 -1
  5. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/_available_/with_This_video_does_not_exist_or_has_been_deleted_/{available_ → _available_}/.yml +12 -19
  6. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/_available_/with_valid_video/{available_ → _available_}/.yml +10 -15
  7. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/{view_count → _date}/.yml +12 -17
  8. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/{keywords → _description}/.yml +12 -17
  9. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/{date → _duration}/.yml +12 -17
  10. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/{thumbnail_large → _keywords}/.yml +12 -17
  11. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_large/.yml +58 -0
  12. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_medium/.yml +58 -0
  13. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_small/.yml +58 -0
  14. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_title/.yml +58 -0
  15. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_view_count/.yml +58 -0
  16. data/spec/fixtures/vcr_cassettes/{VideoInfo_Providers_VimeoPlaylist/_available_/with_valid_playlist/available_ → VideoInfo_Providers_Vimeo/_available_/with_password_required_video/_available_}/.yml +28 -36
  17. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_this_video_does_not_exist_video/{available_ → _available_}/.yml +11 -11
  18. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_valid_video/{available_ → _available_}/.yml +13 -13
  19. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_date/.yml +73 -0
  20. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_description/.yml +73 -0
  21. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_duration/.yml +73 -0
  22. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_height/.yml +73 -0
  23. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_keywords/.yml +73 -0
  24. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_large/.yml +73 -0
  25. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_medium/.yml +73 -0
  26. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_small/.yml +73 -0
  27. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_title/.yml +73 -0
  28. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_view_count/.yml +73 -0
  29. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_width/.yml +73 -0
  30. data/spec/fixtures/vcr_cassettes/{VideoInfo_Providers_Vimeo/_available_/with_password_required_video/available_ → VideoInfo_Providers_VimeoPlaylist/_available_/with_invalid_playlist/_available_}/.yml +12 -12
  31. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/_available_/with_valid_playlist/_available_/.yml +54 -0
  32. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_1921098/_description/.yml +71 -0
  33. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_1921098/_thumbnail_large/.yml +71 -0
  34. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_1921098/_thumbnail_medium/.yml +71 -0
  35. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_1921098/_thumbnail_small/.yml +71 -0
  36. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_1921098/_title/.yml +71 -0
  37. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_1921098/_videos/.yml +104 -0
  38. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_invalid_video/_available_/.yml +46 -0
  39. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_valid_video/_available_/.yml +1137 -0
  40. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video-54799401_165822734/_title/.yml +1363 -0
  41. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/_description/.yml +1137 -0
  42. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/_duration/.yml +1137 -0
  43. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/_embed_code/.yml +1137 -0
  44. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/_embed_url/.yml +1137 -0
  45. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/_height/.yml +1137 -0
  46. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/_keywords/.yml +1137 -0
  47. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/_title/.yml +1137 -0
  48. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/_view_count/.yml +1137 -0
  49. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/_width/.yml +1137 -0
  50. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_valid_video/{available_ → _available_}/.yml +9 -9
  51. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_is_unavailable_video/{available_ → _available_}/.yml +6 -6
  52. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_no_longer_available_due_to_a_copyright_claim_video/{available_ → _available_}/.yml +6 -6
  53. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_date/.yml +61 -0
  54. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_description/.yml +61 -0
  55. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_duration/.yml +61 -0
  56. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_keywords/.yml +61 -0
  57. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_thumbnail_large/.yml +61 -0
  58. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_thumbnail_medium/.yml +61 -0
  59. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_thumbnail_small/.yml +61 -0
  60. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_title/.yml +61 -0
  61. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_view_count/.yml +61 -0
  62. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_invalid_playlist/{available_ → _available_}/.yml +6 -6
  63. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_valid_playlist/{available_ → _available_}/.yml +9 -9
  64. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL0E8117603D70E10A_in_embed_path/_videos/.yml +61 -0
  65. data/spec/fixtures/vcr_cassettes/{VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/title → VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_description}/.yml +27 -95
  66. data/spec/fixtures/vcr_cassettes/{VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/thumbnail_medium → VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_large}/.yml +31 -97
  67. data/spec/fixtures/vcr_cassettes/{VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/thumbnail_small → VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_medium}/.yml +31 -101
  68. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_small/.yml +98 -0
  69. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_title/.yml +98 -0
  70. data/spec/fixtures/vcr_cassettes/{VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/description → VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_videos}/.yml +27 -95
  71. data/spec/lib/video_info/providers/dailymotion_spec.rb +101 -23
  72. data/spec/lib/video_info/providers/vimeo_playlist_spec.rb +110 -32
  73. data/spec/lib/video_info/providers/vimeo_spec.rb +134 -29
  74. data/spec/lib/video_info/providers/vkontakte_spec.rb +95 -21
  75. data/spec/lib/video_info/providers/youtube_playlist_spec.rb +110 -25
  76. data/spec/lib/video_info/providers/youtube_spec.rb +206 -47
  77. data/spec/lib/video_info_spec.rb +20 -20
  78. data/spec/spec_helper.rb +1 -5
  79. data/video_info.gemspec +1 -0
  80. metadata +148 -178
  81. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/_available_/with_video_is_unavailable_video/available_/.yml +0 -46
  82. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/_available_/with_video_no_longer_available_due_to_a_copyright_claim_video/available_/.yml +0 -46
  83. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/description/.yml +0 -63
  84. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/duration/.yml +0 -63
  85. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/thumbnail_medium/.yml +0 -63
  86. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/thumbnail_small/.yml +0 -63
  87. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/title/.yml +0 -63
  88. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/date/.yml +0 -76
  89. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/description/.yml +0 -76
  90. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/duration/.yml +0 -76
  91. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/height/.yml +0 -76
  92. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/keywords/.yml +0 -76
  93. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/thumbnail_large/.yml +0 -76
  94. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/thumbnail_medium/.yml +0 -76
  95. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/thumbnail_small/.yml +0 -76
  96. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/title/.yml +0 -76
  97. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/view_count/.yml +0 -76
  98. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/width/.yml +0 -76
  99. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/_available_/with_invalid_playlist/available_/.yml +0 -152
  100. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/date/.yml +0 -75
  101. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/duration/.yml +0 -75
  102. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/height/.yml +0 -71
  103. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/keywords/.yml +0 -75
  104. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/thumbnail_large/.yml +0 -168
  105. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/videos/.yml +0 -202
  106. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/view_count/.yml +0 -71
  107. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/width/.yml +0 -71
  108. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_invalid_video/available_/.yml +0 -147
  109. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_valid_video/available_/.yml +0 -1115
  110. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/description/.yml +0 -1139
  111. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/duration/.yml +0 -1139
  112. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/embed_code/.yml +0 -1139
  113. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/embed_url/.yml +0 -1139
  114. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/height/.yml +0 -1139
  115. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/keywords/.yml +0 -1139
  116. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/title/.yml +0 -1139
  117. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/view_count/.yml +0 -1139
  118. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/width/.yml +0 -1139
  119. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video-54799401_165822734/title/.yml +0 -1331
  120. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/description/.yml +0 -1125
  121. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/duration/.yml +0 -1125
  122. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/embed_code/.yml +0 -1125
  123. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/embed_url/.yml +0 -1125
  124. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/height/.yml +0 -1125
  125. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/keywords/.yml +0 -1125
  126. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/title/.yml +0 -1084
  127. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/view_count/.yml +0 -1125
  128. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/width/.yml +0 -1125
  129. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/date/.yml +0 -61
  130. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/description/.yml +0 -61
  131. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/duration/.yml +0 -61
  132. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/keywords/.yml +0 -63
  133. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/thumbnail_large/.yml +0 -61
  134. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/thumbnail_medium/.yml +0 -61
  135. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/thumbnail_small/.yml +0 -61
  136. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/title/.yml +0 -63
  137. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/view_count/.yml +0 -61
  138. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL0E8117603D70E10A_in_embed_path/videos/.yml +0 -61
  139. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/.yml +0 -98
  140. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/date/.yml +0 -98
  141. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/description/.yml +0 -98
  142. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/duration/.yml +0 -98
  143. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/keywords/.yml +0 -98
  144. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/thumbnail_large/.yml +0 -96
  145. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/thumbnail_medium/.yml +0 -96
  146. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/thumbnail_small/.yml +0 -98
  147. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/title/.yml +0 -98
  148. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/videos/.yml +0 -96
  149. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/view_count/.yml +0 -98
@@ -7,61 +7,138 @@ describe VideoInfo::Providers::Vimeo do
7
7
 
8
8
  context "with vimeo url" do
9
9
  let(:url) { 'http://www.vimeo.com/898029' }
10
- it { should be_true }
10
+ it { is_expected.to be_truthy }
11
+ end
12
+
13
+ context "with Vimeo OnDemand url" do
14
+ let(:url) { 'https://vimeo.com/ondemand/less/101677664' }
15
+ it { is_expected.to be_truthy }
11
16
  end
12
17
 
13
18
  context "with vimeo album url" do
14
19
  let(:url) { 'http://vimeo.com/album/2755718' }
15
- it { should be_false }
20
+ it { is_expected.to be_falsey }
16
21
  end
17
22
 
18
23
  context "with vimeo hubnub embed url" do
19
24
  let(:url) { 'http://player.vimeo.com/hubnut/album/2755718' }
20
- it { should be_false }
25
+ it { is_expected.to be_falsey }
21
26
  end
22
27
 
23
28
  context "with other url" do
24
29
  let(:url) { 'http://www.youtube.com/898029' }
25
- it { should be_false }
30
+ it { is_expected.to be_falsey }
26
31
  end
27
32
  end
28
33
 
29
34
  describe "#available?" do
30
35
  context "with valid video", :vcr do
31
36
  subject { VideoInfo.new('http://www.vimeo.com/898029') }
32
- its(:available?) { should be_true }
37
+
38
+ describe '#available?' do
39
+ it { is_expected.to be_available }
40
+ end
33
41
  end
34
42
 
35
43
  context "with 'this video does not exist' video", :vcr do
36
44
  subject { VideoInfo.new('http://vimeo.com/59312311') }
37
- its(:available?) { should be_false }
45
+
46
+ describe '#available?' do
47
+ it { is_expected.to_not be_available }
48
+ end
38
49
  end
39
50
 
40
51
  context "with 'password required' video", :vcr do
41
- subject { VideoInfo.new('http://vimeo.com/54189727') }
42
- its(:available?) { should be_false }
52
+ subject { VideoInfo.new('http://vimeo.com/74636562') }
53
+
54
+ describe '#available?' do
55
+ it { is_expected.to_not be_available }
56
+ end
43
57
  end
44
58
  end
45
59
 
46
60
  context "with video 898029", :vcr do
47
61
  subject { VideoInfo.new('http://www.vimeo.com/898029') }
48
62
 
49
- its(:provider) { should eq 'Vimeo' }
50
- its(:video_id) { should eq '898029' }
51
- its(:url) { should eq 'http://www.vimeo.com/898029' }
52
- its(:embed_url) { should eq '//player.vimeo.com/video/898029' }
53
- its(:embed_code) { should eq '<iframe src="//player.vimeo.com/video/898029?autoplay=0&byline=0&portrait=0&title=0" frameborder="0"></iframe>' }
54
- its(:title) { should eq 'Cherry Bloom - King Of The Knife' }
55
- its(:description) { should eq 'The first video from the upcoming album Secret Sounds, to download in-stores April 14. Checkout http://www.cherrybloom.net' }
56
- its(:keywords) { should eq 'cherry bloom, secret sounds, king of the knife, rock, alternative' }
57
- its(:duration) { should eq 175 }
58
- its(:width) { should eq 640 }
59
- its(:height) { should eq 360 }
60
- its(:date) { should eq Time.parse('2008-04-14 13:10:39', Time.now.utc) }
61
- its(:thumbnail_small) { should eq 'http://b.vimeocdn.com/ts/343/731/34373130_100.jpg' }
62
- its(:thumbnail_medium) { should eq 'http://b.vimeocdn.com/ts/343/731/34373130_200.jpg' }
63
- its(:thumbnail_large) { should eq 'http://b.vimeocdn.com/ts/343/731/34373130_640.jpg' }
64
- its(:view_count) { should be > 4000 }
63
+ describe '#provider' do
64
+ subject { super().provider }
65
+ it { is_expected.to eq 'Vimeo' }
66
+ end
67
+
68
+ describe '#video_id' do
69
+ subject { super().video_id }
70
+ it { is_expected.to eq '898029' }
71
+ end
72
+
73
+ describe '#url' do
74
+ subject { super().url }
75
+ it { is_expected.to eq 'http://www.vimeo.com/898029' }
76
+ end
77
+
78
+ describe '#embed_url' do
79
+ subject { super().embed_url }
80
+ it { is_expected.to eq '//player.vimeo.com/video/898029' }
81
+ end
82
+
83
+ describe '#embed_code' do
84
+ subject { super().embed_code }
85
+ it { is_expected.to eq '<iframe src="//player.vimeo.com/video/898029?autoplay=0&byline=0&portrait=0&title=0" frameborder="0"></iframe>' }
86
+ end
87
+
88
+ describe '#title' do
89
+ subject { super().title }
90
+ it { is_expected.to eq 'Cherry Bloom - King Of The Knife' }
91
+ end
92
+
93
+ describe '#description' do
94
+ subject { super().description }
95
+ it { is_expected.to eq 'The first video from the upcoming album Secret Sounds, to download in-stores April 14. Checkout http://www.cherrybloom.net' }
96
+ end
97
+
98
+ describe '#keywords' do
99
+ subject { super().keywords }
100
+ it { is_expected.to eq 'cherry bloom, secret sounds, king of the knife, rock, alternative' }
101
+ end
102
+
103
+ describe '#duration' do
104
+ subject { super().duration }
105
+ it { is_expected.to eq 175 }
106
+ end
107
+
108
+ describe '#width' do
109
+ subject { super().width }
110
+ it { is_expected.to eq 640 }
111
+ end
112
+
113
+ describe '#height' do
114
+ subject { super().height }
115
+ it { is_expected.to eq 360 }
116
+ end
117
+
118
+ describe '#date' do
119
+ subject { super().date }
120
+ it { is_expected.to eq Time.parse('2008-04-14 13:10:39', Time.now.utc) }
121
+ end
122
+
123
+ describe '#thumbnail_small' do
124
+ subject { super().thumbnail_small }
125
+ it { is_expected.to eq 'http://i.vimeocdn.com/video/34373130_100x75.jpg' }
126
+ end
127
+
128
+ describe '#thumbnail_medium' do
129
+ subject { super().thumbnail_medium }
130
+ it { is_expected.to eq 'http://i.vimeocdn.com/video/34373130_200x150.jpg' }
131
+ end
132
+
133
+ describe '#thumbnail_large' do
134
+ subject { super().thumbnail_large }
135
+ it { is_expected.to eq 'http://i.vimeocdn.com/video/34373130_640.jpg' }
136
+ end
137
+
138
+ describe '#view_count' do
139
+ subject { super().view_count }
140
+ it { is_expected.to be > 4000 }
141
+ end
65
142
  end
66
143
 
67
144
  context "with video 898029 and url_attributes", :vcr do
@@ -80,22 +157,50 @@ describe VideoInfo::Providers::Vimeo do
80
157
  context "with video 898029 in /group/ url", :vcr do
81
158
  subject { VideoInfo.new('http://vimeo.com/groups/1234/videos/898029') }
82
159
 
83
- its(:provider) { should eq 'Vimeo' }
84
- its(:video_id) { should eq '898029' }
160
+ describe '#provider' do
161
+ subject { super().provider }
162
+ it { is_expected.to eq 'Vimeo' }
163
+ end
164
+
165
+ describe '#video_id' do
166
+ subject { super().video_id }
167
+ it { is_expected.to eq '898029' }
168
+ end
85
169
  end
86
170
 
87
171
  context "with video 898029 in /group/ url", :vcr do
88
172
  subject { VideoInfo.new('http://player.vimeo.com/video/898029') }
89
173
 
90
- its(:provider) { should eq 'Vimeo' }
91
- its(:video_id) { should eq '898029' }
174
+ describe '#provider' do
175
+ subject { super().provider }
176
+ it { is_expected.to eq 'Vimeo' }
177
+ end
178
+
179
+ describe '#video_id' do
180
+ subject { super().video_id }
181
+ it { is_expected.to eq '898029' }
182
+ end
92
183
  end
93
184
 
94
185
  context "with video 898029 in text", :vcr do
95
186
  subject { VideoInfo.new('<a href="http://www.vimeo.com/898029">http://www.vimeo.com/898029</a>') }
96
187
 
188
+ describe '#provider' do
189
+ subject { super().provider }
190
+ it { is_expected.to eq 'Vimeo' }
191
+ end
192
+
193
+ describe '#video_id' do
194
+ subject { super().video_id }
195
+ it { is_expected.to eq '898029' }
196
+ end
197
+ end
198
+
199
+ context "with video 101677664 in /ondemand/ url", :vcr do
200
+ subject { VideoInfo.new('https://vimeo.com/ondemand/less/101677664') }
201
+
97
202
  its(:provider) { should eq 'Vimeo' }
98
- its(:video_id) { should eq '898029' }
203
+ its(:video_id) { should eq '101677664' }
99
204
  end
100
205
 
101
206
  end
@@ -8,24 +8,32 @@ describe VideoInfo::Providers::Vkontakte do
8
8
 
9
9
  context "with vkontakte url" do
10
10
  let(:url) { 'http://vk.com/video39576223_108370515' }
11
- it { should be_true }
11
+ it { is_expected.to be_truthy }
12
12
  end
13
13
 
14
14
  context "with other url" do
15
15
  let(:url) { 'http://www.youtube.com/898029' }
16
- it { should be_false }
16
+ it { is_expected.to be_falsey }
17
17
  end
18
18
  end
19
19
 
20
20
  describe "#available?" do
21
21
  context "with valid video", :vcr do
22
22
  subject { VideoInfo.new('http://vk.com/video39576223_108370515') }
23
- its(:available?) { should be_true }
23
+
24
+ describe '#available?' do
25
+ subject { super().available? }
26
+ it { is_expected.to be_truthy }
27
+ end
24
28
  end
25
29
 
26
30
  context "with invalid video", :vcr do
27
31
  subject { VideoInfo.new('http://vk.com/video39576223_invalid') }
28
- its(:available?) { should be_false }
32
+
33
+ describe '#available?' do
34
+ subject { super().available? }
35
+ it { is_expected.to be_falsey }
36
+ end
29
37
  end
30
38
 
31
39
  end
@@ -33,28 +41,94 @@ describe VideoInfo::Providers::Vkontakte do
33
41
  context "with video video39576223_108370515", :vcr do
34
42
  subject { VideoInfo.new('http://vk.com/video39576223_108370515') }
35
43
 
36
- its(:provider) { should eq 'Vkontakte' }
37
- its(:video_owner) { should eq '39576223' }
38
- its(:video_id) { should eq '108370515' }
39
- its(:url) { should eq 'http://vk.com/video39576223_108370515' }
40
- its(:embed_url) { should eq '//vk.com/video_ext.php?oid=39576223&id=108370515&hash=15184dbd085c47af' }
41
- its(:embed_code) { should eq '<iframe src="//vk.com/video_ext.php?oid=39576223&id=108370515&hash=15184dbd085c47af" frameborder="0" allowfullscreen="allowfullscreen"></iframe>' }
42
- its(:title) { should eq 'Я уточка))))) | VK' }
43
- its(:description) { should eq 'это ВЗРЫВ МОЗГА!!! Просто отвал башки...' }
44
- its(:keywords) { should eq 'это ВЗРЫВ МОЗГА!!! Просто отвал башки...' }
45
- its(:duration) { should eq 183 }
46
- its(:width) { should eq 320 }
47
- its(:height) { should eq 240 }
48
- its(:view_count) { should be > 10 }
44
+ describe '#provider' do
45
+ subject { super().provider }
46
+ it { is_expected.to eq 'Vkontakte' }
47
+ end
48
+
49
+ describe '#video_owner' do
50
+ subject { super().video_owner }
51
+ it { is_expected.to eq '39576223' }
52
+ end
53
+
54
+ describe '#video_id' do
55
+ subject { super().video_id }
56
+ it { is_expected.to eq '108370515' }
57
+ end
58
+
59
+ describe '#url' do
60
+ subject { super().url }
61
+ it { is_expected.to eq 'http://vk.com/video39576223_108370515' }
62
+ end
63
+
64
+ describe '#embed_url' do
65
+ subject { super().embed_url }
66
+ it { is_expected.to eq '//vk.com/video_ext.php?oid=39576223&id=108370515&hash=15184dbd085c47af' }
67
+ end
68
+
69
+ describe '#embed_code' do
70
+ subject { super().embed_code }
71
+ it { is_expected.to eq '<iframe src="//vk.com/video_ext.php?oid=39576223&id=108370515&hash=15184dbd085c47af" frameborder="0" allowfullscreen="allowfullscreen"></iframe>' }
72
+ end
73
+
74
+ describe '#title' do
75
+ subject { super().title }
76
+ it { is_expected.to eq 'Я уточка))))) | VK' }
77
+ end
78
+
79
+ describe '#description' do
80
+ subject { super().description }
81
+ it { is_expected.to eq 'это ВЗРЫВ МОЗГА!!! Просто отвал башки...' }
82
+ end
83
+
84
+ describe '#keywords' do
85
+ subject { super().keywords }
86
+ it { is_expected.to eq 'это ВЗРЫВ МОЗГА!!! Просто отвал башки...' }
87
+ end
88
+
89
+ describe '#duration' do
90
+ subject { super().duration }
91
+ it { is_expected.to eq 183 }
92
+ end
93
+
94
+ describe '#width' do
95
+ subject { super().width }
96
+ it { is_expected.to eq 320 }
97
+ end
98
+
99
+ describe '#height' do
100
+ subject { super().height }
101
+ it { is_expected.to eq 240 }
102
+ end
103
+
104
+ describe '#view_count' do
105
+ subject { super().view_count }
106
+ it { is_expected.to be > 10 }
107
+ end
49
108
  end
50
109
 
51
110
  context "with video video-54799401_165822734", :vcr do
52
111
  subject { VideoInfo.new('http://vk.com/video-54799401_165822734') }
53
112
 
54
- its(:provider) { should eq 'Vkontakte' }
55
- its(:video_owner) { should eq '-54799401' }
56
- its(:video_id) { should eq '165822734' }
57
- its(:title) { should eq 'SpaceGlasses are the future of computing | VK' }
113
+ describe '#provider' do
114
+ subject { super().provider }
115
+ it { is_expected.to eq 'Vkontakte' }
116
+ end
117
+
118
+ describe '#video_owner' do
119
+ subject { super().video_owner }
120
+ it { is_expected.to eq '-54799401' }
121
+ end
122
+
123
+ describe '#video_id' do
124
+ subject { super().video_id }
125
+ it { is_expected.to eq '165822734' }
126
+ end
127
+
128
+ describe '#title' do
129
+ subject { super().title }
130
+ it { is_expected.to eq 'SpaceGlasses are the future of computing | VK' }
131
+ end
58
132
  end
59
133
 
60
134
  end
@@ -7,29 +7,37 @@ describe VideoInfo::Providers::YoutubePlaylist do
7
7
 
8
8
  context "with youtube.com/playlist url" do
9
9
  let(:url) { 'http://www.youtube.com/playlist?p=PLA575C81A1FBC04CF' }
10
- it { should be_true }
10
+ it { is_expected.to be_truthy }
11
11
  end
12
12
 
13
13
  context "with youtube.com url" do
14
14
  let(:url) { 'http://www.youtube.com/watch?v=Xp6CXF' }
15
- it { should be_false }
15
+ it { is_expected.to be_falsey }
16
16
  end
17
17
 
18
18
  context "with other url" do
19
19
  let(:url) { 'http://example.com/video1' }
20
- it { should be_false }
20
+ it { is_expected.to be_falsey }
21
21
  end
22
22
  end
23
23
 
24
24
  describe "#available?" do
25
25
  context "with valid playlist", :vcr do
26
26
  subject { VideoInfo.new('http://www.youtube.com/playlist?p=PLA575C81A1FBC04CF') }
27
- its(:available?) { should be_true }
27
+
28
+ describe '#available?' do
29
+ subject { super().available? }
30
+ it { is_expected.to be_truthy }
31
+ end
28
32
  end
29
33
 
30
34
  context "with invalid playlist", :vcr do
31
35
  subject { VideoInfo.new('http://www.youtube.com/playlist?p=PLA575C81A1FBC04CF_invalid') }
32
- its(:available?) { should be_false }
36
+
37
+ describe '#available?' do
38
+ subject { super().available? }
39
+ it { is_expected.to be_falsey }
40
+ end
33
41
  end
34
42
  end
35
43
 
@@ -45,36 +53,113 @@ describe VideoInfo::Providers::YoutubePlaylist do
45
53
  }
46
54
  subject { VideoInfo.new('http://www.youtube.com/playlist?p=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr') }
47
55
 
48
- its(:provider) { should eq 'YouTube' }
49
- its(:playlist_id) { should eq 'PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
50
- its(:url) { should eq 'http://www.youtube.com/playlist?p=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
51
- its(:embed_url) { should eq '//www.youtube.com/embed/videoseries?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
52
- its(:embed_code) { should eq '<iframe src="//www.youtube.com/embed/videoseries?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr" frameborder="0" allowfullscreen="allowfullscreen"></iframe>' }
53
- its(:title) { should eq 'YouTube Policy and Copyright' }
54
- its(:description) { should eq 'Learn more about copyright basics, flagging, and the YouTube community.' }
55
- its(:keywords) { should be_nil }
56
- its(:duration) { should be_nil }
57
- its(:width) { should be_nil }
58
- its(:height) { should be_nil }
59
- its(:date) { should be_nil }
60
- its(:thumbnail_small) { should eq 'http://i.ytimg.com/vi/8b0aEoxqqC0/default.jpg' }
61
- its(:thumbnail_medium) { should eq 'http://i.ytimg.com/vi/8b0aEoxqqC0/mqdefault.jpg' }
62
- its(:thumbnail_large) { should eq 'http://i.ytimg.com/vi/8b0aEoxqqC0/hqdefault.jpg' }
63
- its(:videos) { should match_array(videos) }
64
- its(:view_count) { should be_nil }
56
+ describe '#provider' do
57
+ subject { super().provider }
58
+ it { is_expected.to eq 'YouTube' }
59
+ end
60
+
61
+ describe '#playlist_id' do
62
+ subject { super().playlist_id }
63
+ it { is_expected.to eq 'PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
64
+ end
65
+
66
+ describe '#url' do
67
+ subject { super().url }
68
+ it { is_expected.to eq 'http://www.youtube.com/playlist?p=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
69
+ end
70
+
71
+ describe '#embed_url' do
72
+ subject { super().embed_url }
73
+ it { is_expected.to eq '//www.youtube.com/embed/videoseries?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
74
+ end
75
+
76
+ describe '#embed_code' do
77
+ subject { super().embed_code }
78
+ it { is_expected.to eq '<iframe src="//www.youtube.com/embed/videoseries?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr" frameborder="0" allowfullscreen="allowfullscreen"></iframe>' }
79
+ end
80
+
81
+ describe '#title' do
82
+ subject { super().title }
83
+ it { is_expected.to eq 'YouTube Policy and Copyright' }
84
+ end
85
+
86
+ describe '#description' do
87
+ subject { super().description }
88
+ it { is_expected.to eq 'Learn more about copyright basics, flagging, and the YouTube community.' }
89
+ end
90
+
91
+ describe '#keywords' do
92
+ subject { super().keywords }
93
+ it { is_expected.to be_nil }
94
+ end
95
+
96
+ describe '#duration' do
97
+ subject { super().duration }
98
+ it { is_expected.to be_nil }
99
+ end
100
+
101
+ describe '#width' do
102
+ subject { super().width }
103
+ it { is_expected.to be_nil }
104
+ end
105
+
106
+ describe '#height' do
107
+ subject { super().height }
108
+ it { is_expected.to be_nil }
109
+ end
110
+
111
+ describe '#date' do
112
+ subject { super().date }
113
+ it { is_expected.to be_nil }
114
+ end
115
+
116
+ describe '#thumbnail_small' do
117
+ subject { super().thumbnail_small }
118
+ it { is_expected.to eq 'https://i.ytimg.com/vi/8b0aEoxqqC0/default.jpg' }
119
+ end
120
+
121
+ describe '#thumbnail_medium' do
122
+ subject { super().thumbnail_medium }
123
+ it { is_expected.to eq 'https://i.ytimg.com/vi/8b0aEoxqqC0/mqdefault.jpg' }
124
+ end
125
+
126
+ describe '#thumbnail_large' do
127
+ subject { super().thumbnail_large }
128
+ it { is_expected.to eq 'https://i.ytimg.com/vi/8b0aEoxqqC0/hqdefault.jpg' }
129
+ end
130
+
131
+ describe '#videos' do
132
+ subject { super().videos }
133
+ it { is_expected.to match_array(videos) }
134
+ end
135
+
136
+ describe '#view_count' do
137
+ subject { super().view_count }
138
+ it { is_expected.to be_nil }
139
+ end
65
140
  end
66
141
 
67
142
  context "with playlist PL0E8117603D70E10A in embed path", :vcr do
68
143
  subject { VideoInfo.new('http://www.youtube.com/embed/videoseries?list=PL0E8117603D70E10A') }
69
144
 
70
- its(:playlist_id) { should eq 'PL0E8117603D70E10A' }
71
- its(:videos) { should eq [] }
145
+ describe '#playlist_id' do
146
+ subject { super().playlist_id }
147
+ it { is_expected.to eq 'PL0E8117603D70E10A' }
148
+ end
149
+
150
+ describe '#videos' do
151
+ subject { super().videos }
152
+ it { is_expected.to eq [] }
153
+ end
72
154
  end
73
155
 
74
156
  context "with playlist PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr in embed path", :vcr do
75
157
  subject { VideoInfo.new('http://www.youtube.com/embed/videoseries?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr') }
76
158
 
77
- its(:playlist_id) { should eq 'PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
159
+ describe '#playlist_id' do
160
+ subject { super().playlist_id }
161
+ it { is_expected.to eq 'PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
162
+ end
78
163
  end
79
164
 
80
165