Sha256: f09dde68f69f9e96831652bf79ed0e147a90ecf7d3a22d5405fb4d0907e98401
Contents?: true
Size: 864 Bytes
Versions: 24
Compression:
Stored size: 864 Bytes
Contents
require 'spec_helper' describe GH::Pagination do before { subject.backend = GH::MockBackend.new } it 'paginates' do counter = subject['users/rkh/repos'].map { 1 }.reduce(:+) # map/reduce! counter.should be > 120 end it 'paginates with GH::Normalizer' do subject.backend = GH::Normalizer.new subject.backend counter = subject['users/rkh/repos'].map { 1 }.reduce(:+) # map/reduce! counter.should be > 120 end it 'paginates on default stack' do counter = GH['users/rkh/repos'].map { 1 }.reduce(:+) # map/reduce! counter.should be > 120 end it 'gives random access' do data = subject['users/rkh/repos'] data.each_with_index do |value, index| data[index].should be == value end end it 'does not wrap hash responses' do subject['users/rkh'].should_not be_a(GH::Pagination::Paginated) end end
Version data entries
24 entries across 24 versions & 1 rubygems