Sha256: cfef63ea0fcd88d3410a895566d31ceb8755d28bc366456a735f356e6e2b3a35

Contents?: true

Size: 650 Bytes

Versions: 1

Compression:

Stored size: 650 Bytes

Contents

require 'spec_helper'

describe EPUBInfo do
  let(:epub_path) { File.expand_path('spec/support/binary/metamorphosis_epub2.epub') }

  describe '#get' do
    it 'calls parser' do
      document = EPUBInfo::Parser.parse(epub_path).metadata_document
      parser = double
      parser.stub(:metadata_document)
      parser.stub(:drm_protected?)
      EPUBInfo::Parser.should_receive(:parse) { parser }
      EPUBInfo.get(epub_path)
    end

    it 'instanstiates a book model and returns it' do
      book_mock = double
      EPUBInfo::Models::Book.should_receive(:new) { book_mock }
      EPUBInfo.get(epub_path).should == book_mock
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
epubinfo_with_toc-0.5.7 spec/lib/epubinfo_spec.rb