Sha256: 502ba50fff6431e6857b301bc4d5ffaa66787a6c8e9704fd3435933370d1db9d

Contents?: true

Size: 795 Bytes

Versions: 73

Compression:

Stored size: 795 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Bolognese::Metadata, vcr: true do
  context "write metadata as crossref" do
    it "journal article" do
      input = fixture_path + 'crossref.xml'
      subject = Bolognese::Metadata.new(input: input)
      crossref = Maremma.from_xml(subject.crossref).dig("doi_records", "doi_record")
      expect(crossref.dig("crossref", "journal", "journal_metadata", "full_title")).to eq("PLoS ONE")
      expect(crossref.dig("crossref", "journal", "journal_article", "doi_data", "doi")).to eq("10.1371/journal.pone.0000030")
    end

    it "from DataCite" do
      input = "https://doi.org/10.5061/DRYAD.8515"
      subject = Bolognese::Metadata.new(input: input, from: "datacite")
      expect(subject.crossref).to be nil
    end
  end
end

Version data entries

73 entries across 73 versions & 1 rubygems

Version Path
bolognese-1.1.17 spec/writers/crossref_writer_spec.rb
bolognese-1.1.16 spec/writers/crossref_writer_spec.rb
bolognese-1.1.15 spec/writers/crossref_writer_spec.rb
bolognese-1.1.14 spec/writers/crossref_writer_spec.rb
bolognese-1.1.13 spec/writers/crossref_writer_spec.rb
bolognese-1.1.12 spec/writers/crossref_writer_spec.rb
bolognese-1.1.11 spec/writers/crossref_writer_spec.rb
bolognese-1.1.8 spec/writers/crossref_writer_spec.rb
bolognese-1.1.7 spec/writers/crossref_writer_spec.rb
bolognese-1.1.6 spec/writers/crossref_writer_spec.rb
bolognese-1.1.5 spec/writers/crossref_writer_spec.rb
bolognese-1.1.4 spec/writers/crossref_writer_spec.rb
bolognese-1.1.3 spec/writers/crossref_writer_spec.rb
bolognese-1.1.2 spec/writers/crossref_writer_spec.rb
bolognese-1.1.1 spec/writers/crossref_writer_spec.rb
bolognese-1.1 spec/writers/crossref_writer_spec.rb
bolognese-1.0.36 spec/writers/crossref_writer_spec.rb
bolognese-1.0.35 spec/writers/crossref_writer_spec.rb
bolognese-1.0.34 spec/writers/crossref_writer_spec.rb
bolognese-1.0.33 spec/writers/crossref_writer_spec.rb