Sha256: d5bd4b7bf72089a880234cb53684f578ba944ac1f3e7258ee0ba781d3a0367e6

Contents?: true

Size: 555 Bytes

Versions: 1

Compression:

Stored size: 555 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
      EPUBInfo::Parser.should_receive(:parse) { document }
      EPUBInfo.get(epub_path)
    end

    it 'instanstiates a book model and returns it' do
      book_mock = mock
      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-0.2.1 spec/lib/epubinfo_spec.rb