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

Version Path
gh-0.13.0 spec/pagination_spec.rb
gh-0.12.4 spec/pagination_spec.rb
gh-0.12.3 spec/pagination_spec.rb
gh-0.12.2 spec/pagination_spec.rb
gh-0.12.1 spec/pagination_spec.rb
gh-0.12.0 spec/pagination_spec.rb
gh-0.11.3 spec/pagination_spec.rb
gh-0.11.2 spec/pagination_spec.rb
gh-0.11.1 spec/pagination_spec.rb
gh-0.11.0 spec/pagination_spec.rb
gh-0.10.3 spec/pagination_spec.rb
gh-0.10.2 spec/pagination_spec.rb
gh-0.10.1 spec/pagination_spec.rb
gh-0.10.0 spec/pagination_spec.rb
gh-0.9.2 spec/pagination_spec.rb
gh-0.9.1 spec/pagination_spec.rb
gh-0.9.0 spec/pagination_spec.rb
gh-0.8.0 spec/pagination_spec.rb
gh-0.7.3 spec/pagination_spec.rb
gh-0.7.1 spec/pagination_spec.rb