add tests about is_interesting_file

This commit is contained in:
Leeingnyo 2021-01-26 04:18:09 +09:00
parent 2b0cf41336
commit 0ba2409c9a

View File

@ -35,6 +35,26 @@ describe "compare_numerically" do
end end
end end
describe "is_interesting_file" do
it "returns true when filename has interesting file extension" do
filename = "manga.cbz"
result = is_interesting_file filename
result.should eq true
end
it "returns false if file extension is not interesting" do
filename = "info.json"
result = is_interesting_file filename
result.should eq false
end
it "returns true when fileext has uppercase" do
filename = "manga.ZiP"
result = is_interesting_file filename
result.should eq true
end
end
describe "chapter_sort" do describe "chapter_sort" do
it "sorts correctly" do it "sorts correctly" do
ary = ["Vol.1 Ch.01", "Vol.1 Ch.02", "Vol.2 Ch. 2.5", "Ch. 3", "Ch.04"] ary = ["Vol.1 Ch.01", "Vol.1 Ch.02", "Vol.2 Ch. 2.5", "Ch. 3", "Ch.04"]