Sha256: c157fa357a4636eee6c1e291b3063abc39e1a2e3af614be2b3e3bfdb0b53d5fe

Contents?: true

Size: 1.07 KB

Versions: 21

Compression:

Stored size: 1.07 KB

Contents

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 bibtex raw" do
    it "BlogPosting" do
      expect(subject.raw).to eq(IO.read(input))
    end
  end

  context "get citeproc metadata" do
    it "BlogPosting" do
      expect(subject.valid?).to be true
      expect(subject.id).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.type).to eq("BlogPosting")
      expect(subject.resource_type_general).to eq("Text")
      expect(subject.author).to eq("type"=>"Person", "name"=>"Martin Fenner", "givenName"=>"Martin", "familyName"=>"Fenner")
      expect(subject.title).to eq("Eating your own Dog Food")
      expect(subject.description["text"]).to start_with("Eating your own dog food")
      expect(subject.date_published).to eq("2016-12-20")
      expect(subject.is_part_of).to eq("type"=>"Periodical", "title"=>"DataCite Blog")
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
bolognese-0.9.33 spec/readers/citeproc_reader_spec.rb
bolognese-0.9.32 spec/readers/citeproc_reader_spec.rb
bolognese-0.9.31 spec/readers/citeproc_reader_spec.rb
bolognese-0.9.30 spec/readers/citeproc_reader_spec.rb
bolognese-0.9.29 spec/readers/citeproc_reader_spec.rb
bolognese-0.9.28 spec/readers/citeproc_reader_spec.rb
bolognese-0.9.27 spec/readers/citeproc_reader_spec.rb
bolognese-0.9.26 spec/readers/citeproc_reader_spec.rb
bolognese-0.9.25 spec/readers/citeproc_reader_spec.rb
bolognese-0.9.24 spec/readers/citeproc_reader_spec.rb
bolognese-0.9.23 spec/readers/citeproc_reader_spec.rb
bolognese-0.9.22 spec/readers/citeproc_reader_spec.rb
bolognese-0.9.21 spec/readers/citeproc_reader_spec.rb
bolognese-0.9.20 spec/readers/citeproc_reader_spec.rb
bolognese-0.9.19 spec/readers/citeproc_reader_spec.rb
bolognese-0.9.18 spec/readers/citeproc_reader_spec.rb
bolognese-0.9.17 spec/readers/citeproc_reader_spec.rb
bolognese-0.9.16 spec/readers/citeproc_reader_spec.rb
bolognese-0.9.15 spec/readers/citeproc_reader_spec.rb
bolognese-0.9.14 spec/readers/citeproc_reader_spec.rb