YPBT 0.2.9 → 0.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,61 +1,61 @@
1
- # frozen_string_literal: true
2
- require_relative 'spec_helper.rb'
3
-
4
- describe 'Video specifications' do
5
- VCR.configure do |c|
6
- c.cassette_library_dir = CASSETTES_FOLDER
7
- c.hook_into :webmock
8
-
9
- c.filter_sensitive_data('<API_KEY>') { ENV['YOUTUBE_API_KEY'] }
10
- c.filter_sensitive_data('<API_KEY_ESCAPED>') do
11
- URI.escape(ENV['YOUTUBE_API_KEY'])
12
- end
13
- end
14
-
15
- before do
16
- VCR.insert_cassette CASSETTE_FILE, record: :new_episodes
17
- end
18
-
19
- after do
20
- VCR.eject_cassette
21
- end
22
-
23
- describe 'YtApi Credentials' do
24
- it 'should be able to get a new api key with ENV credentials' do
25
- YoutubeVideo::YtApi.api_key.length.must_be :>, 0
26
- end
27
- it 'should be able to get a new access token with file credentials' do
28
- YoutubeVideo::YtApi.config = { api_key: ENV['YOUTUBE_API_KEY'] }
29
- end
30
-
31
- it 'should be able to open a video' do
32
- video = YoutubeVideo::Video.find(
33
- video_id: TEST_VIDEO_ID
34
- )
35
- video.title.length.must_be :>, 0
36
- video.channel_id.length.must_be :>, 0
37
- end
38
-
39
- it 'should have comments' do
40
- video = YoutubeVideo::Video.find(video_id: TEST_VIDEO_ID)
41
- video.comments.length.must_be :>, 1
42
- end
43
-
44
- it 'should have channel information' do
45
- video = YoutubeVideo::Video.find(video_id: TEST_VIDEO_ID)
46
- video.title.length.must_be :>, 0
47
- video.channel_description.length.must_be :>, 0
48
- video.channel_image_url.must_match(/https:/)
49
- end
50
-
51
- it 'should able to get popular videos' do
52
- videos = YoutubeVideo::Video.find_popular(max_results: 25)
53
- videos.length.must_be :==, 25
54
- end
55
-
56
- it 'should run the executable file' do
57
- output = `YPBT #{TEST_VIDEO_ID}`
58
- output.split("\n").length.must_be :>, 5
59
- end
60
- end
61
- end
1
+ # frozen_string_literal: true
2
+ require_relative 'spec_helper.rb'
3
+
4
+ describe 'Video specifications' do
5
+ VCR.configure do |c|
6
+ c.cassette_library_dir = CASSETTES_FOLDER
7
+ c.hook_into :webmock
8
+
9
+ c.filter_sensitive_data('<API_KEY>') { ENV['YOUTUBE_API_KEY'] }
10
+ c.filter_sensitive_data('<API_KEY_ESCAPED>') do
11
+ URI.escape(ENV['YOUTUBE_API_KEY'])
12
+ end
13
+ end
14
+
15
+ before do
16
+ VCR.insert_cassette CASSETTE_FILE, record: :new_episodes
17
+ end
18
+
19
+ after do
20
+ VCR.eject_cassette
21
+ end
22
+
23
+ describe 'YtApi Credentials' do
24
+ it 'should be able to get a new api key with ENV credentials' do
25
+ YoutubeVideo::YtApi.api_key.length.must_be :>, 0
26
+ end
27
+ it 'should be able to get a new access token with file credentials' do
28
+ YoutubeVideo::YtApi.config = { api_key: ENV['YOUTUBE_API_KEY'] }
29
+ end
30
+
31
+ it 'should be able to open a video' do
32
+ video = YoutubeVideo::Video.find(
33
+ video_id: TEST_VIDEO_ID
34
+ )
35
+ video.title.length.must_be :>, 0
36
+ video.channel_id.length.must_be :>, 0
37
+ end
38
+
39
+ it 'should have comments' do
40
+ video = YoutubeVideo::Video.find(video_id: TEST_VIDEO_ID)
41
+ video.comments.length.must_be :>, 1
42
+ end
43
+
44
+ it 'should have channel information' do
45
+ video = YoutubeVideo::Video.find(video_id: TEST_VIDEO_ID)
46
+ video.title.length.must_be :>, 0
47
+ video.channel_description.length.must_be :>, 0
48
+ video.channel_image_url.must_match(/https:/)
49
+ end
50
+
51
+ it 'should able to get popular videos' do
52
+ videos = YoutubeVideo::Video.find_popular(max_results: 25)
53
+ videos.length.must_be :==, 25
54
+ end
55
+
56
+ it 'should run the executable file' do
57
+ output = `YPBT #{TEST_VIDEO_ID}`
58
+ output.split("\n").length.must_be :>, 5
59
+ end
60
+ end
61
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: YPBT
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.2.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yi-Min
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-12-17 00:00:00.000000000 Z
13
+ date: 2020-10-31 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: http
@@ -214,15 +214,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
214
214
  requirements:
215
215
  - - ">="
216
216
  - !ruby/object:Gem::Version
217
- version: '0'
217
+ version: '2.6'
218
218
  required_rubygems_version: !ruby/object:Gem::Requirement
219
219
  requirements:
220
220
  - - ">="
221
221
  - !ruby/object:Gem::Version
222
222
  version: '0'
223
223
  requirements: []
224
- rubyforge_project:
225
- rubygems_version: 2.6.8
224
+ rubygems_version: 3.0.8
226
225
  signing_key:
227
226
  specification_version: 4
228
227
  summary: Gets comment from public Youtube videos