Sha256: cbef44da301c15c9cd283b7c99139cbcf297752ef0efcfe6f3d3cec4bd11756c

Contents?: true

Size: 1.19 KB

Versions: 6

Compression:

Stored size: 1.19 KB

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Bolognese::Metadata, vcr: true do
  let(:input) { fixture_path + "citeproc.json" }

  subject { Bolognese::Metadata.new(input: input, from: "citeproc") }

  context "get citeproc raw" do
    it "BlogPosting" do
      expect(subject.raw).to eq(IO.read(input).strip)
    end
  end

  context "get citeproc metadata" do
    it "BlogPosting" do
      expect(subject.valid?).to be true
      expect(subject.identifier).to eq("https://doi.org/10.5438/4k3m-nyvg")
      expect(subject.url).to eq("https://blog.datacite.org/eating-your-own-dog-food")
      expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"post-weblog", "resourceTypeGeneral"=>"Text", "ris"=>"GEN", "schemaOrg"=>"BlogPosting")
      expect(subject.creator).to eq([{"familyName"=>"Fenner", "givenName"=>"Martin", "name"=>"Martin Fenner", "type"=>"Person"}])
      expect(subject.titles).to eq([{"title"=>"Eating your own Dog Food"}])
      expect(subject.descriptions.first["description"]).to start_with("Eating your own dog food")
      expect(subject.dates).to eq([{"date"=>"2016-12-20", "dateType"=>"Issued"}])
      expect(subject.publication_year).to eq("2016")
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bolognese-1.0.13 spec/readers/citeproc_reader_spec.rb
bolognese-1.0.12 spec/readers/citeproc_reader_spec.rb
bolognese-1.0.11 spec/readers/citeproc_reader_spec.rb
bolognese-1.0.10 spec/readers/citeproc_reader_spec.rb
bolognese-1.0.9 spec/readers/citeproc_reader_spec.rb
bolognese-1.0.8 spec/readers/citeproc_reader_spec.rb