X-Git-Url: http://jaekl.net/gitweb/?p=quanlib.git;a=blobdiff_plain;f=test%2Fbook_test.rb;fp=test%2Fbook_test.rb;h=64a2892b0f9903926744a72182a801c63be2207f;hp=0000000000000000000000000000000000000000;hb=9c227ac21d693fa2903a7c07e643cba99cd69031;hpb=8853161a81df93fb7ddb36e5dc2991f40fd230f0 diff --git a/test/book_test.rb b/test/book_test.rb new file mode 100644 index 0000000..64a2892 --- /dev/null +++ b/test/book_test.rb @@ -0,0 +1,17 @@ + +require 'rspec/autorun' +require_relative '../book' + +describe Book do + it "can handle .epub and .pdf files" do + ['epub', 'pdf'].each do |extension| + expect(Book.can_handle?("sample.#{extension}")).to be true + end + end + + it "cannot handle .mobi, .html, .txt, .doc, .zip, .rtf or .rar files" do + %w(doc html mobi rar rtf txt zip).each do |extension| + expect(Book.can_handle?("sample.#{extension}")).to be false + end + end +end