spec/readers/codemeta_reader_spec.rb in bolognese-1.6.3 vs spec/readers/codemeta_reader_spec.rb in bolognese-1.6.4

- old
+ new

@@ -34,10 +34,15 @@ expect(subject.descriptions.first["description"]).to start_with("Ruby utility library for network requests") expect(subject.subjects).to eq([{"subject"=>"faraday"}, {"subject"=>"excon"}, {"subject"=>"net/http"}]) expect(subject.dates).to eq([{"date"=>"2017-02-24", "dateType"=>"Issued"}, {"date"=>"2015-11-28", "dateType"=>"Created"}, {"date"=>"2017-02-24", "dateType"=>"Updated"}]) expect(subject.publication_year).to eq("2017") expect(subject.publisher).to eq("DataCite") + expect(subject.rights_list).to eq([{"rights"=>"MIT License", + "rightsIdentifier"=>"MIT", + "rightsIdentifierScheme"=>"SPDX", + "rightsUri"=>"https://opensource.org/licenses/MIT", + "schemeUri"=>"https://spdx.org/licenses/"}]) end it "rdataone" do input = fixture_path + 'codemeta.json' subject = Bolognese::Metadata.new(input: input) @@ -70,10 +75,15 @@ expect(subject.subjects).to eq([{"subject"=>"data sharing"}, {"subject"=>"data repository"}, {"subject"=>"DataONE"}]) expect(subject.version_info).to eq("2.0.0") expect(subject.dates).to eq([{"date"=>"2016-05-27", "dateType"=>"Issued"}, {"date"=>"2016-05-27", "dateType"=>"Created"}, {"date"=>"2016-05-27", "dateType"=>"Updated"}]) expect(subject.publication_year).to eq("2016") expect(subject.publisher).to eq("https://cran.r-project.org") + expect(subject.rights_list).to eq([{"rights"=>"Apache License 2.0", + "rightsIdentifier"=>"Apache-2.0", + "rightsIdentifierScheme"=>"SPDX", + "rightsUri"=>"http://www.apache.org/licenses/LICENSE-2.0", + "schemeUri"=>"https://spdx.org/licenses/"}]) end it "maremma" do input = fixture_path + 'maremma/codemeta.json' subject = Bolognese::Metadata.new(input: input) @@ -94,10 +104,15 @@ expect(subject.descriptions.first["description"]).to start_with("Simplifies network calls") expect(subject.subjects).to eq([{"subject"=>"faraday"}, {"subject"=>"excon"}, {"subject"=>"net/http"}]) expect(subject.dates).to eq([{"date"=>"2017-02-24", "dateType"=>"Issued"}, {"date"=>"2015-11-28", "dateType"=>"Created"}, {"date"=>"2017-02-24", "dateType"=>"Updated"}]) expect(subject.publication_year).to eq("2017") expect(subject.publisher).to eq("DataCite") + expect(subject.rights_list).to eq([{"rights"=>"MIT License", + "rightsIdentifier"=>"MIT", + "rightsIdentifierScheme"=>"SPDX", + "rightsUri"=>"https://opensource.org/licenses/MIT", + "schemeUri"=>"https://spdx.org/licenses/"}]) end it "metadata_reports" do input = "https://github.com/datacite/metadata-reports/blob/master/software/codemeta.json" subject = Bolognese::Metadata.new(input: input) @@ -111,8 +126,13 @@ expect(subject.descriptions.first["description"]).to start_with("Analysis of DataCite DOIs registered for software") expect(subject.subjects).to eq([{"subject"=>"doi"}, {"subject"=>"software"}, {"subject"=>"codemeta"}]) expect(subject.dates).to eq([{"date"=>"2018-05-17", "dateType"=>"Issued"}, {"date"=>"2018-03-09", "dateType"=>"Created"}, {"date"=>"2018-05-17", "dateType"=>"Updated"}]) expect(subject.publication_year).to eq("2018") expect(subject.publisher).to eq("DataCite") + expect(subject.rights_list).to eq([{"rights"=>"MIT License", + "rightsIdentifier"=>"MIT", + "rightsIdentifierScheme"=>"SPDX", + "rightsUri"=>"https://opensource.org/licenses/MIT", + "schemeUri"=>"https://spdx.org/licenses/"}]) end end end