spec/metadata_spec.rb in bolognese-0.8.13 vs spec/metadata_spec.rb in bolognese-0.9
- old
+ new
@@ -63,6 +63,26 @@
it "codemeta" do
string = IO.read(fixture_path + "codemeta.json")
expect(subject.find_from_format(string: string, filename: "codemeta.json")).to eq("codemeta")
end
end
+
+ 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 "missing_comma" do
+ json = IO.read(fixture_path + "datacite_software_missing_comma.json")
+ response = subject.jsonlint(json)
+ expect(response).to eq(["expected comma, not a string at line 4, column 11 [parse.c:381]"])
+ end
+
+ it "overlapping_keys" do
+ json = IO.read(fixture_path + "datacite_software_overlapping_keys.json")
+ response = subject.jsonlint(json)
+ expect(response).to eq(["The same key is defined more than once: id"])
+ end
+ end
end