Sha256: 3c3a6b0ffc20a9ae19434139d4093beb9e8c2753896e13b0bf6c8a651138b434

Contents?: true

Size: 594 Bytes

Versions: 1

Compression:

Stored size: 594 Bytes

Contents

require 'spec_helper'
require 'bootleg/page'

describe Bootleg::Page do

  it 'raises KeyError if not initialized with a nokogiri-page' do
    expect{described_class.new(not_page: 'not page')}.
      to raise_error(KeyError, 'key not found: :page')
  end

  let(:link) { double 'Link' }
  let(:nokogiri_page) { double 'Nokogiri Page' }
  subject { described_class.new(page: nokogiri_page) }

  it 'returns "Last Page" if no more pages' do
    allow(nokogiri_page).to receive(:link_with).
      with(class: 'next-showtime').and_return(nil)
    expect(subject.next).to eq('Last Page')
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bootleg-0.0.7 spec/lib/page_spec.rb