Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/yt/actions/list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def first!

def list
@last_index, @page_token = 0, nil
Yt::Iterator.new(-> {total_results}) do |items|
Enumerator.new(-> {total_results}) do |items|
while next_item = find_next
items << next_item
end
Expand Down
16 changes: 0 additions & 16 deletions lib/yt/models/iterator.rb

This file was deleted.

2 changes: 1 addition & 1 deletion spec/collections/comment_threads_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
describe Yt::Collections::CommentThreads do
subject(:collection) { Yt::Collections::CommentThreads.new parent: parent}

describe '#size', :ruby2 do
describe '#size' do
describe 'sends only one request and return the total results' do
let(:total_results) { 1234 }
let(:parent) { Yt::Video.new id: 'any-id' }
Expand Down
4 changes: 2 additions & 2 deletions spec/collections/videos_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
let(:channel) { Yt::Channel.new id: 'any-id' }
let(:page) { {items: [], token: 'any-token'} }

describe '#size', :ruby2 do
describe '#size' do
describe 'sends only one request and return the total results' do
let(:total_results) { 123456 }
before do
Expand Down Expand Up @@ -40,4 +40,4 @@
end
end
end
end
end
2 changes: 1 addition & 1 deletion spec/requests/as_content_owner/content_owner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
expect(partnered_channels.first).to be_a Yt::Channel
end

specify '.size', :ruby2 do
specify '.size' do
expect(partnered_channels.size).to be > 0
end
end
Expand Down
6 changes: 3 additions & 3 deletions spec/requests/as_server_app/comment_threads_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
require 'yt/models/channel'

describe Yt::Collections::CommentThreads, :server_app, :vcr do
context "without parent association", :ruby2 do
context "without parent association" do
subject(:comment_threads) { Yt::Collections::CommentThreads.new }

specify 'without given any of id, videoId, channelId or allThreadsRelatedToChannelId param, raise request error', :ruby2 do
specify 'without given any of id, videoId, channelId or allThreadsRelatedToChannelId param, raise request error' do
expect{ comment_threads.size }.to raise_error(Yt::Errors::RequestError)
end

Expand All @@ -26,7 +26,7 @@
# end
end

context "with parent association", :ruby2 do
context "with parent association" do
subject(:comment_threads) { Yt::Collections::CommentThreads.new parent: parent}

context "parent as video" do
Expand Down
4 changes: 2 additions & 2 deletions spec/requests/as_server_app/videos_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
describe Yt::Collections::Videos, :server_app, :vcr do
subject(:videos) { Yt::Collections::Videos.new }

specify 'without :where conditions, returns all YouTube videos', :ruby2 do
specify 'without :where conditions, returns all YouTube videos' do
expect(videos.size).to be > 100_000
end

Expand All @@ -21,7 +21,7 @@
it { expect(videos_by_id.first.id).to eq video_id }
end

specify 'with a chart parameter, only returns videos of that chart', :ruby2 do
specify 'with a chart parameter, only returns videos of that chart' do
expect(videos.where(chart: 'mostPopular').size).to be 200
end

Expand Down
5 changes: 0 additions & 5 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,4 @@
RSpec.configure do |config|
config.order = 'random'
config.run_all_when_everything_filtered = false
# @note: Some tests might take too long to run on Ruby 1.9.3 which does not
# support "size" for Enumerator, so we are better off skipping them.
config.filter_run_excluding ruby2: true if RUBY_VERSION < '2'
# @note: See https://github.com/Fullscreen/yt/issues/103
config.filter_run_excluding ruby21: true if RUBY_VERSION < '2.1'
end
4 changes: 2 additions & 2 deletions yt.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
spec.homepage = "http://github.com/Fullscreen/yt"
spec.license = "MIT"

spec.required_ruby_version = '>= 1.9.3'
spec.required_ruby_version = '>= 2.1'

spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
Expand All @@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]

spec.add_dependency 'activesupport' # '3 (Ruby 1.9) or 4 (Ruby 2)'
spec.add_dependency 'activesupport'

# For development / Code coverage / Documentation
spec.add_development_dependency 'bundler'
Expand Down