Sha256: 9c3d55f01884a00f31c75a264af40f7ecc470f84274bb48c0aac92d5b6782196

Contents?: true

Size: 1002 Bytes

Versions: 6

Compression:

Stored size: 1002 Bytes

Contents

require 'spec_helper'

describe Bolognese::Metadata, vcr: true do

  subject { Bolognese::Metadata.new }

  context "find PID provider" do
    it "crossref" do
      id = "https://doi.org/10.1371/journal.pone.0000030"
      expect(subject.find_provider(id)).to eq("crossref")
    end

    it "crossref doi not url" do
      id = "10.1371/journal.pone.0000030"
      expect(subject.find_provider(id)).to eq("crossref")
    end

    it "datacite" do
      id = "https://doi.org/10.5438/4K3M-NYVG"
      expect(subject.find_provider(id)).to eq("datacite")
    end

    it "datacite doi http" do
      id = "http://doi.org/10.5438/4K3M-NYVG"
      expect(subject.find_provider(id)).to eq("datacite")
    end

    it "orcid" do
      id = "http://orcid.org/0000-0002-0159-2197"
      expect(subject.find_provider(id)).to eq("orcid")
    end

    it "schema_org" do
      id = "https://blog.datacite.org/eating-your-own-dog-food"
      expect(subject.find_provider(id)).to eq("schema_org")
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bolognese-0.6.2 spec/metadata_spec.rb
bolognese-0.6.1 spec/metadata_spec.rb
bolognese-0.5.3 spec/metadata_spec.rb
bolognese-0.5.2 spec/metadata_spec.rb
bolognese-0.5.1 spec/metadata_spec.rb
bolognese-0.5 spec/metadata_spec.rb