Add `arrived` attribute (file creation timestamp) to books table.
[quanlib.git] / test / book_test.rb
1
2 require 'rspec/autorun'
3 require_relative '../book'
4
5 describe Book do
6   it "can handle .epub and .pdf files" do
7     ['epub', 'pdf'].each do |extension|
8       expect(Book.can_handle?("sample.#{extension}")).to be true
9     end
10   end
11
12   it "cannot handle .mobi, .html, .txt, .doc, .zip, .rtf or .rar files" do
13     %w(doc html mobi rar rtf txt zip).each do |extension|
14       expect(Book.can_handle?("sample.#{extension}")).to be false
15     end
16   end
17 end