yt 0.32.6 → 0.33.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +1 -4
- data/CHANGELOG.md +19 -0
- data/README.md +22 -32
- data/YOUTUBE_IT.md +4 -4
- data/lib/yt.rb +0 -1
- data/lib/yt/associations/has_reports.rb +9 -14
- data/lib/yt/collections/reports.rb +5 -7
- data/lib/yt/models/resource.rb +69 -3
- data/lib/yt/models/url.rb +2 -60
- data/lib/yt/request.rb +6 -2
- data/lib/yt/version.rb +1 -1
- data/yt.gemspec +5 -2
- metadata +31 -169
- data/spec/collections/claims_spec.rb +0 -62
- data/spec/collections/comment_threads_spec.rb +0 -46
- data/spec/collections/playlist_items_spec.rb +0 -44
- data/spec/collections/playlists_spec.rb +0 -27
- data/spec/collections/policies_spec.rb +0 -30
- data/spec/collections/references_spec.rb +0 -30
- data/spec/collections/reports_spec.rb +0 -30
- data/spec/collections/subscriptions_spec.rb +0 -25
- data/spec/collections/videos_spec.rb +0 -43
- data/spec/constants/geography_spec.rb +0 -16
- data/spec/errors/forbidden_spec.rb +0 -10
- data/spec/errors/missing_auth_spec.rb +0 -24
- data/spec/errors/no_items_spec.rb +0 -10
- data/spec/errors/request_error_spec.rb +0 -44
- data/spec/errors/server_error_spec.rb +0 -10
- data/spec/errors/unauthorized_spec.rb +0 -10
- data/spec/models/account_spec.rb +0 -138
- data/spec/models/annotation_spec.rb +0 -180
- data/spec/models/asset_spec.rb +0 -32
- data/spec/models/channel_spec.rb +0 -127
- data/spec/models/claim_event_spec.rb +0 -62
- data/spec/models/claim_history_spec.rb +0 -27
- data/spec/models/claim_spec.rb +0 -223
- data/spec/models/comment_spec.rb +0 -40
- data/spec/models/comment_thread_spec.rb +0 -93
- data/spec/models/configuration_spec.rb +0 -44
- data/spec/models/content_detail_spec.rb +0 -52
- data/spec/models/content_owner_detail_spec.rb +0 -6
- data/spec/models/file_detail_spec.rb +0 -13
- data/spec/models/live_streaming_detail_spec.rb +0 -6
- data/spec/models/ownership_spec.rb +0 -59
- data/spec/models/player_spec.rb +0 -13
- data/spec/models/playlist_item_spec.rb +0 -120
- data/spec/models/playlist_spec.rb +0 -138
- data/spec/models/policy_rule_spec.rb +0 -63
- data/spec/models/policy_spec.rb +0 -41
- data/spec/models/rating_spec.rb +0 -12
- data/spec/models/reference_spec.rb +0 -249
- data/spec/models/request_spec.rb +0 -204
- data/spec/models/resource_spec.rb +0 -42
- data/spec/models/right_owner_spec.rb +0 -71
- data/spec/models/snippet_spec.rb +0 -13
- data/spec/models/statistics_set_spec.rb +0 -13
- data/spec/models/status_spec.rb +0 -13
- data/spec/models/subscription_spec.rb +0 -30
- data/spec/models/url_spec.rb +0 -78
- data/spec/models/video_category_spec.rb +0 -21
- data/spec/models/video_spec.rb +0 -669
- data/spec/requests/as_account/account_spec.rb +0 -143
- data/spec/requests/as_account/authentications_spec.rb +0 -127
- data/spec/requests/as_account/channel_spec.rb +0 -246
- data/spec/requests/as_account/channels_spec.rb +0 -18
- data/spec/requests/as_account/playlist_item_spec.rb +0 -55
- data/spec/requests/as_account/playlist_spec.rb +0 -218
- data/spec/requests/as_account/thumbnail.jpg +0 -0
- data/spec/requests/as_account/video.mp4 +0 -0
- data/spec/requests/as_account/video_spec.rb +0 -408
- data/spec/requests/as_content_owner/account_spec.rb +0 -29
- data/spec/requests/as_content_owner/advertising_options_set_spec.rb +0 -15
- data/spec/requests/as_content_owner/asset_spec.rb +0 -31
- data/spec/requests/as_content_owner/bulk_report_job_spec.rb +0 -19
- data/spec/requests/as_content_owner/channel_spec.rb +0 -1836
- data/spec/requests/as_content_owner/claim_history_spec.rb +0 -20
- data/spec/requests/as_content_owner/claim_spec.rb +0 -17
- data/spec/requests/as_content_owner/content_owner_spec.rb +0 -370
- data/spec/requests/as_content_owner/match_policy_spec.rb +0 -17
- data/spec/requests/as_content_owner/ownership_spec.rb +0 -25
- data/spec/requests/as_content_owner/playlist_spec.rb +0 -767
- data/spec/requests/as_content_owner/video_group_spec.rb +0 -112
- data/spec/requests/as_content_owner/video_spec.rb +0 -1223
- data/spec/requests/as_server_app/channel_spec.rb +0 -54
- data/spec/requests/as_server_app/comment_spec.rb +0 -22
- data/spec/requests/as_server_app/comment_thread_spec.rb +0 -27
- data/spec/requests/as_server_app/comment_threads_spec.rb +0 -41
- data/spec/requests/as_server_app/playlist_item_spec.rb +0 -30
- data/spec/requests/as_server_app/playlist_spec.rb +0 -33
- data/spec/requests/as_server_app/url_spec.rb +0 -94
- data/spec/requests/as_server_app/video_spec.rb +0 -60
- data/spec/requests/as_server_app/videos_spec.rb +0 -40
- data/spec/requests/unauthenticated/video_spec.rb +0 -14
- data/spec/spec_helper.rb +0 -20
- data/spec/support/fail_matcher.rb +0 -15
- data/spec/support/global_hooks.rb +0 -48
@@ -1,15 +0,0 @@
|
|
1
|
-
RSpec::Matchers.define :fail do
|
2
|
-
supports_block_expectations
|
3
|
-
match do |block|
|
4
|
-
begin
|
5
|
-
block.call
|
6
|
-
false
|
7
|
-
rescue Yt::Error => error
|
8
|
-
@reason ? error.reasons.include?(@reason) : true
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
chain :with do |reason|
|
13
|
-
@reason = reason
|
14
|
-
end
|
15
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
require 'yt/config'
|
2
|
-
require 'yt/models/account'
|
3
|
-
require 'yt/models/content_owner'
|
4
|
-
|
5
|
-
RSpec.configure do |config|
|
6
|
-
# Create one global test account to avoid having to refresh the access token
|
7
|
-
# at every request
|
8
|
-
config.before :all do
|
9
|
-
attrs = {refresh_token: ENV['YT_TEST_DEVICE_REFRESH_TOKEN']}
|
10
|
-
$account = Yt::Account.new attrs
|
11
|
-
end
|
12
|
-
|
13
|
-
# Don't use authentication from env variables unless specified with a tag
|
14
|
-
config.before :all do
|
15
|
-
Yt.configure do |config|
|
16
|
-
config.client_id = nil
|
17
|
-
config.client_secret = nil
|
18
|
-
config.api_key = nil
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
config.before :all, device_app: true do
|
23
|
-
Yt.configure do |config|
|
24
|
-
config.client_id = ENV['YT_TEST_DEVICE_CLIENT_ID']
|
25
|
-
config.client_secret = ENV['YT_TEST_DEVICE_CLIENT_SECRET']
|
26
|
-
config.log_level = ENV['YT_LOG_LEVEL']
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
config.before :all, server_app: true do
|
31
|
-
Yt.configure do |config|
|
32
|
-
config.api_key = ENV['YT_TEST_SERVER_API_KEY']
|
33
|
-
config.log_level = ENV['YT_LOG_LEVEL']
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
config.before :all, partner: true do
|
38
|
-
Yt.configure do |config|
|
39
|
-
config.client_id = ENV['YT_TEST_PARTNER_CLIENT_ID']
|
40
|
-
config.client_secret = ENV['YT_TEST_PARTNER_CLIENT_SECRET']
|
41
|
-
config.log_level = ENV['YT_LOG_LEVEL']
|
42
|
-
end
|
43
|
-
# Create one Youtube Partner channel, authenticated as the content owner
|
44
|
-
attrs = {refresh_token: ENV['YT_TEST_CONTENT_OWNER_REFRESH_TOKEN']}
|
45
|
-
attrs[:owner_name] = ENV['YT_TEST_CONTENT_OWNER_NAME']
|
46
|
-
$content_owner = Yt::ContentOwner.new attrs
|
47
|
-
end
|
48
|
-
end
|