Skip to content

Commit

Permalink
ignore youtube api key
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienpoly committed Jul 8, 2023
1 parent eafc0d0 commit 20c8ddd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions test/clients/youtube/channels_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ class Youtube::ChannelsTest < ActiveSupport::TestCase
end

test "should retreive the channel id from the user name" do
VCR.use_cassette("youtube/channels") do
VCR.use_cassette("youtube/channels", match_requests_on: [:method]) do
channel_id = Youtube::Channels.new.id_by_name(channel_name: "confreaks")
assert_equal "UCWnPjmqvljcafA0z2U1fwKQ", channel_id
end
end

test "should retreive the channel id from the user name with dash" do
VCR.use_cassette("youtube/channels-scrapping") do
VCR.use_cassette("youtube/channels-scrapping", match_requests_on: [:method]) do
channel_id = Youtube::Channels.new.id_by_name(channel_name: "paris-rb")
assert_equal "UCFKE6QHGPAkISMj1SQdqnnw", channel_id
end
Expand Down
2 changes: 1 addition & 1 deletion test/clients/youtube/playlist_items_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require "test_helper"
class Youtube::PlaylistItemsTest < ActiveSupport::TestCase
test "should retreive the playlist of a channel" do
VCR.use_cassette("youtube/playlist_items/all") do
VCR.use_cassette("youtube/playlist_items/all", match_requests_on: [:method]) do
items = Youtube::PlaylistItems.new.all(playlist_id: "PLE7tQUdRKcyZYz0O3d9ZDdo0-BkOWhrSk")
assert items.is_a?(Array)
assert items.length > 50
Expand Down
2 changes: 1 addition & 1 deletion test/clients/youtube/playlists_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require "test_helper"
class Youtube::PlaylistsTest < ActiveSupport::TestCase
test "should retreive the playlist of a channel" do
VCR.use_cassette("youtube/playlists/all") do
VCR.use_cassette("youtube/playlists/all", match_requests_on: [:method]) do
playlists = Youtube::Playlists.new.all(channel_id: "UCWnPjmqvljcafA0z2U1fwKQ")
assert playlists.is_a?(Array)
assert playlists.length > 50
Expand Down
4 changes: 2 additions & 2 deletions test/clients/youtube/video_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def setup
test "should return statistics for a valid video" do
video_id = "9LfmrkyP81M"

VCR.use_cassette("youtube_statistics") do
VCR.use_cassette("youtube_statistics", match_requests_on: [:method]) do
stats = @client.get_statistics(video_id)
assert_not_nil stats
assert stats.has_key?(:view_count)
Expand All @@ -20,7 +20,7 @@ def setup
test "should return nil for an invalid video" do
video_id = "invalid_video_id"

VCR.use_cassette("youtube_statistics_invalid") do
VCR.use_cassette("youtube_statistics_invalid", match_requests_on: [:method]) do
stats = @client.get_statistics(video_id)
assert_nil stats
end
Expand Down

0 comments on commit 20c8ddd

Please sign in to comment.