muse-dl/spec/book_spec.cr

28 lines
1.0 KiB
Crystal
Raw Normal View History

2020-03-28 20:02:55 +00:00
require "./spec_helper"
describe Muse::Dl::Book do
2020-03-28 20:14:43 +00:00
it "it should parse the infobox for 875" do
html = File.new("spec/fixtures/book-875.html").gets_to_end
2020-03-28 20:02:55 +00:00
book = Muse::Dl::Book.new html
book.info["ISBN"].should eq "9780813928517"
book.info["Related ISBN"].should eq "9780813928456"
book.info["OCLC"].should eq "755633557"
book.info["Pages"].should eq "432"
book.info["Launched on MUSE"].should eq "2012-01-01"
book.info["Language"].should eq "English"
book.info["Open Access"].should eq "No"
2020-03-28 20:14:43 +00:00
end
it "it should parse the DOI for 68534" do
html = File.new("spec/fixtures/book-68534.html").gets_to_end
book = Muse::Dl::Book.new html
book.info["ISBN"].should eq "9781501737695"
book.info["Related ISBN"].should eq "9781501742583"
book.info["OCLC"].should eq "1122613406"
book.info["Launched on MUSE"].should eq "2019-10-10"
book.info["Language"].should eq "English"
book.info["Open Access"].should eq "Yes"
2020-03-28 20:02:55 +00:00
book.info["DOI"].should eq "10.1353/book.68534"
end
end