projects
/
quanlib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8853161
)
Add a simple test for Book
author
Chris Jaekl
<chris@localhost>
Sat, 14 Mar 2020 00:33:53 +0000
(20:33 -0400)
committer
Chris Jaekl
<chris@localhost>
Sat, 14 Mar 2020 00:33:53 +0000
(20:33 -0400)
test/book_test.rb
[new file with mode: 0644]
patch
|
blob
diff --git a/test/book_test.rb
b/test/book_test.rb
new file mode 100644
(file)
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