spec/lib/epubinfo_spec.rb in epubinfo-0.2.0 vs spec/lib/epubinfo_spec.rb in epubinfo-0.2.1
- old
+ new
@@ -3,11 +3,18 @@
describe EPUBInfo do
let(:epub_path) { File.expand_path('spec/support/binary/metamorphosis_epub2.epub') }
describe '#get' do
it 'calls parser' do
- EPUBInfo::Parser.should_receive(:parse)
+ 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