spec/metadata_spec.rb in bolognese-0.9.8 vs spec/metadata_spec.rb in bolognese-0.9.9

- old
+ new

@@ -1,11 +1,11 @@ require 'spec_helper' describe Bolognese::Metadata, vcr: true do + let(:input) { "http://doi.org/10.5438/4K3M-NYVG" } + subject { Bolognese::Metadata.new(input: input) } - subject { Bolognese::Metadata.new } - context "find from format by ID" do it "crossref" do id = "https://doi.org/10.1371/journal.pone.0000030" expect(subject.find_from_format(id: id)).to eq("crossref") end @@ -102,9 +102,15 @@ context "jsonlint" do it "valid" do json = IO.read(fixture_path + "datacite_software.json") response = subject.jsonlint(json) expect(response).to be_empty + end + + it "nil" do + json = nil + response = subject.jsonlint(json) + expect(response).to eq(["No JSON provided"]) end it "missing_comma" do json = IO.read(fixture_path + "datacite_software_missing_comma.json") response = subject.jsonlint(json)