yt 0.32.6 → 0.33.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +1 -4
  3. data/CHANGELOG.md +36 -0
  4. data/README.md +22 -33
  5. data/YOUTUBE_IT.md +4 -4
  6. data/lib/yt.rb +1 -1
  7. data/lib/yt/actions/list.rb +1 -1
  8. data/lib/yt/associations/has_reports.rb +9 -14
  9. data/lib/yt/collections/reports.rb +5 -7
  10. data/lib/yt/models/account.rb +13 -3
  11. data/lib/yt/models/channel.rb +19 -4
  12. data/lib/yt/models/resource.rb +74 -3
  13. data/lib/yt/models/status.rb +3 -1
  14. data/lib/yt/models/url.rb +2 -60
  15. data/lib/yt/models/video.rb +16 -1
  16. data/lib/yt/request.rb +7 -4
  17. data/lib/yt/version.rb +1 -1
  18. data/yt.gemspec +5 -2
  19. metadata +32 -170
  20. data/spec/collections/claims_spec.rb +0 -62
  21. data/spec/collections/comment_threads_spec.rb +0 -46
  22. data/spec/collections/playlist_items_spec.rb +0 -44
  23. data/spec/collections/playlists_spec.rb +0 -27
  24. data/spec/collections/policies_spec.rb +0 -30
  25. data/spec/collections/references_spec.rb +0 -30
  26. data/spec/collections/reports_spec.rb +0 -30
  27. data/spec/collections/subscriptions_spec.rb +0 -25
  28. data/spec/collections/videos_spec.rb +0 -43
  29. data/spec/constants/geography_spec.rb +0 -16
  30. data/spec/errors/forbidden_spec.rb +0 -10
  31. data/spec/errors/missing_auth_spec.rb +0 -24
  32. data/spec/errors/no_items_spec.rb +0 -10
  33. data/spec/errors/request_error_spec.rb +0 -44
  34. data/spec/errors/server_error_spec.rb +0 -10
  35. data/spec/errors/unauthorized_spec.rb +0 -10
  36. data/spec/models/account_spec.rb +0 -138
  37. data/spec/models/annotation_spec.rb +0 -180
  38. data/spec/models/asset_spec.rb +0 -32
  39. data/spec/models/channel_spec.rb +0 -127
  40. data/spec/models/claim_event_spec.rb +0 -62
  41. data/spec/models/claim_history_spec.rb +0 -27
  42. data/spec/models/claim_spec.rb +0 -223
  43. data/spec/models/comment_spec.rb +0 -40
  44. data/spec/models/comment_thread_spec.rb +0 -93
  45. data/spec/models/configuration_spec.rb +0 -44
  46. data/spec/models/content_detail_spec.rb +0 -52
  47. data/spec/models/content_owner_detail_spec.rb +0 -6
  48. data/spec/models/file_detail_spec.rb +0 -13
  49. data/spec/models/live_streaming_detail_spec.rb +0 -6
  50. data/spec/models/ownership_spec.rb +0 -59
  51. data/spec/models/player_spec.rb +0 -13
  52. data/spec/models/playlist_item_spec.rb +0 -120
  53. data/spec/models/playlist_spec.rb +0 -138
  54. data/spec/models/policy_rule_spec.rb +0 -63
  55. data/spec/models/policy_spec.rb +0 -41
  56. data/spec/models/rating_spec.rb +0 -12
  57. data/spec/models/reference_spec.rb +0 -249
  58. data/spec/models/request_spec.rb +0 -204
  59. data/spec/models/resource_spec.rb +0 -42
  60. data/spec/models/right_owner_spec.rb +0 -71
  61. data/spec/models/snippet_spec.rb +0 -13
  62. data/spec/models/statistics_set_spec.rb +0 -13
  63. data/spec/models/status_spec.rb +0 -13
  64. data/spec/models/subscription_spec.rb +0 -30
  65. data/spec/models/url_spec.rb +0 -78
  66. data/spec/models/video_category_spec.rb +0 -21
  67. data/spec/models/video_spec.rb +0 -669
  68. data/spec/requests/as_account/account_spec.rb +0 -143
  69. data/spec/requests/as_account/authentications_spec.rb +0 -127
  70. data/spec/requests/as_account/channel_spec.rb +0 -246
  71. data/spec/requests/as_account/channels_spec.rb +0 -18
  72. data/spec/requests/as_account/playlist_item_spec.rb +0 -55
  73. data/spec/requests/as_account/playlist_spec.rb +0 -218
  74. data/spec/requests/as_account/thumbnail.jpg +0 -0
  75. data/spec/requests/as_account/video.mp4 +0 -0
  76. data/spec/requests/as_account/video_spec.rb +0 -408
  77. data/spec/requests/as_content_owner/account_spec.rb +0 -29
  78. data/spec/requests/as_content_owner/advertising_options_set_spec.rb +0 -15
  79. data/spec/requests/as_content_owner/asset_spec.rb +0 -31
  80. data/spec/requests/as_content_owner/bulk_report_job_spec.rb +0 -19
  81. data/spec/requests/as_content_owner/channel_spec.rb +0 -1836
  82. data/spec/requests/as_content_owner/claim_history_spec.rb +0 -20
  83. data/spec/requests/as_content_owner/claim_spec.rb +0 -17
  84. data/spec/requests/as_content_owner/content_owner_spec.rb +0 -370
  85. data/spec/requests/as_content_owner/match_policy_spec.rb +0 -17
  86. data/spec/requests/as_content_owner/ownership_spec.rb +0 -25
  87. data/spec/requests/as_content_owner/playlist_spec.rb +0 -767
  88. data/spec/requests/as_content_owner/video_group_spec.rb +0 -112
  89. data/spec/requests/as_content_owner/video_spec.rb +0 -1223
  90. data/spec/requests/as_server_app/channel_spec.rb +0 -54
  91. data/spec/requests/as_server_app/comment_spec.rb +0 -22
  92. data/spec/requests/as_server_app/comment_thread_spec.rb +0 -27
  93. data/spec/requests/as_server_app/comment_threads_spec.rb +0 -41
  94. data/spec/requests/as_server_app/playlist_item_spec.rb +0 -30
  95. data/spec/requests/as_server_app/playlist_spec.rb +0 -33
  96. data/spec/requests/as_server_app/url_spec.rb +0 -94
  97. data/spec/requests/as_server_app/video_spec.rb +0 -60
  98. data/spec/requests/as_server_app/videos_spec.rb +0 -40
  99. data/spec/requests/unauthenticated/video_spec.rb +0 -14
  100. data/spec/spec_helper.rb +0 -20
  101. data/spec/support/fail_matcher.rb +0 -15
  102. 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