spec/readers/bibtex_reader_spec.rb in bolognese-1.6.12 vs spec/readers/bibtex_reader_spec.rb in bolognese-1.7.1
- old
+ new
@@ -13,11 +13,11 @@
end
it "string" do
Bolognese::Metadata.new(input: IO.read(input).strip)
expect(subject.valid?).to be true
- expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.7554/elife.01567", "identifierType"=>"DOI"}])
+ expect(subject.id).to eq("https://doi.org/10.7554/elife.01567")
end
end
context "get bibtex raw" do
it "Crossref DOI" do
@@ -26,11 +26,11 @@
end
context "get bibtex metadata" do
it "Crossref DOI" do
expect(subject.valid?).to be true
- expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.7554/elife.01567", "identifierType"=>"DOI"}])
+ expect(subject.id).to eq("https://doi.org/10.7554/elife.01567")
expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceTypeGeneral"=>"Text", "resourceType"=>"JournalArticle", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
expect(subject.url).to eq("http://elifesciences.org/lookup/doi/10.7554/eLife.01567")
expect(subject.creators.length).to eq(5)
expect(subject.creators.first).to eq("familyName"=>"Sankar", "givenName"=>"Martial", "name"=>"Sankar, Martial", "nameType"=>"Personal")
expect(subject.titles).to eq([{"title"=>"Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth"}])
@@ -49,10 +49,10 @@
input = fixture_path + "pure.bib"
doi = "10.7554/elife.01567"
subject = Bolognese::Metadata.new(input: input, doi: doi)
expect(subject.valid?).to be false
expect(subject.state).to eq("not_found")
- expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.7554/elife.01567", "identifierType"=>"DOI"}])
+ expect(subject.id).to eq("https://doi.org/10.7554/elife.01567")
expect(subject.types).to eq("bibtex"=>"phdthesis", "citeproc"=>"thesis", "resourceTypeGeneral"=>"Text", "resourceType"=>"Dissertation", "ris"=>"THES", "schemaOrg"=>"Thesis")
expect(subject.creators).to eq([{"familyName"=>"Toparlar", "givenName"=>"Y.", "name"=>"Toparlar, Y.", "nameType"=>"Personal"}])
expect(subject.titles).to eq([{"title"=>"A multiscale analysis of the urban heat island effect: from city averaged temperatures to the energy demand of individual buildings"}])
expect(subject.descriptions.first["description"]).to start_with("Designing the climates of cities")
expect(subject.dates).to eq([{"date"=>"2018", "dateType"=>"Issued"}])