briard 2.4.1 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/codeql-analysis.yml +72 -0
- data/.github/workflows/rubocop.yml +50 -0
- data/.rubocop.yml +144 -620
- data/.rubocop_todo.yml +76 -0
- data/CHANGELOG.md +22 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +43 -6
- data/Rakefile +1 -1
- data/{bolognese.gemspec → briard.gemspec} +46 -38
- data/lib/briard/array.rb +2 -2
- data/lib/briard/author_utils.rb +79 -71
- data/lib/briard/cli.rb +12 -13
- data/lib/briard/crossref_utils.rb +73 -61
- data/lib/briard/datacite_utils.rb +132 -106
- data/lib/briard/doi_utils.rb +10 -10
- data/lib/briard/metadata.rb +96 -106
- data/lib/briard/metadata_utils.rb +87 -78
- data/lib/briard/readers/bibtex_reader.rb +65 -65
- data/lib/briard/readers/cff_reader.rb +88 -70
- data/lib/briard/readers/citeproc_reader.rb +90 -84
- data/lib/briard/readers/codemeta_reader.rb +68 -50
- data/lib/briard/readers/crosscite_reader.rb +2 -2
- data/lib/briard/readers/crossref_reader.rb +249 -210
- data/lib/briard/readers/datacite_json_reader.rb +3 -3
- data/lib/briard/readers/datacite_reader.rb +225 -189
- data/lib/briard/readers/npm_reader.rb +49 -42
- data/lib/briard/readers/ris_reader.rb +82 -80
- data/lib/briard/readers/schema_org_reader.rb +182 -159
- data/lib/briard/string.rb +1 -1
- data/lib/briard/utils.rb +4 -4
- data/lib/briard/version.rb +3 -1
- data/lib/briard/whitelist_scrubber.rb +11 -4
- data/lib/briard/writers/bibtex_writer.rb +14 -8
- data/lib/briard/writers/cff_writer.rb +33 -26
- data/lib/briard/writers/codemeta_writer.rb +19 -15
- data/lib/briard/writers/csv_writer.rb +6 -4
- data/lib/briard/writers/datacite_json_writer.rb +8 -2
- data/lib/briard/writers/jats_writer.rb +33 -28
- data/lib/briard/writers/rdf_xml_writer.rb +1 -1
- data/lib/briard/writers/ris_writer.rb +30 -18
- data/lib/briard/writers/turtle_writer.rb +1 -1
- data/lib/briard.rb +6 -6
- data/rubocop.sarif +0 -0
- data/spec/array_spec.rb +5 -5
- data/spec/author_utils_spec.rb +151 -132
- data/spec/datacite_utils_spec.rb +135 -83
- data/spec/doi_utils_spec.rb +168 -164
- data/spec/find_from_format_spec.rb +69 -69
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/sanitize/onlies_keep_specific_tags.yml +65 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/sanitize/removes_a_tags.yml +65 -0
- data/spec/metadata_spec.rb +91 -90
- data/spec/readers/bibtex_reader_spec.rb +43 -38
- data/spec/readers/cff_reader_spec.rb +165 -153
- data/spec/readers/citeproc_reader_spec.rb +45 -40
- data/spec/readers/codemeta_reader_spec.rb +128 -115
- data/spec/readers/crosscite_reader_spec.rb +34 -24
- data/spec/readers/crossref_reader_spec.rb +1098 -939
- data/spec/readers/datacite_json_reader_spec.rb +53 -40
- data/spec/readers/datacite_reader_spec.rb +1541 -1337
- data/spec/readers/npm_reader_spec.rb +48 -43
- data/spec/readers/ris_reader_spec.rb +53 -47
- data/spec/readers/schema_org_reader_spec.rb +329 -267
- data/spec/spec_helper.rb +6 -5
- data/spec/utils_spec.rb +371 -347
- data/spec/writers/bibtex_writer_spec.rb +143 -143
- data/spec/writers/cff_writer_spec.rb +96 -90
- data/spec/writers/citation_writer_spec.rb +34 -33
- data/spec/writers/citeproc_writer_spec.rb +226 -224
- data/spec/writers/codemeta_writer_spec.rb +18 -16
- data/spec/writers/crosscite_writer_spec.rb +91 -73
- data/spec/writers/crossref_writer_spec.rb +99 -91
- data/spec/writers/csv_writer_spec.rb +70 -70
- data/spec/writers/datacite_json_writer_spec.rb +78 -68
- data/spec/writers/datacite_writer_spec.rb +417 -322
- data/spec/writers/jats_writer_spec.rb +177 -161
- data/spec/writers/rdf_xml_writer_spec.rb +68 -63
- data/spec/writers/ris_writer_spec.rb +162 -162
- data/spec/writers/turtle_writer_spec.rb +47 -47
- metadata +250 -160
- data/.github/workflows/release.yml +0 -47
@@ -3,92 +3,92 @@
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
5
|
describe Briard::Metadata, vcr: true do
|
6
|
-
context
|
7
|
-
it
|
8
|
-
input =
|
9
|
-
subject =
|
10
|
-
csv =
|
6
|
+
context 'write metadata as csv' do
|
7
|
+
it 'with data citation' do
|
8
|
+
input = '10.7554/eLife.01567'
|
9
|
+
subject = described_class.new(input: input, from: 'crossref')
|
10
|
+
csv = subject.csv.parse_csv
|
11
11
|
|
12
|
-
expect(csv[0]).to eq(
|
13
|
-
expect(csv[1]).to eq(
|
14
|
-
expect(csv[2]).to eq(
|
15
|
-
expect(csv[3]).to eq(
|
16
|
-
expect(csv[4]).to eq(
|
17
|
-
expect(csv[5]).to eq(
|
18
|
-
expect(csv[6]).to eq(
|
19
|
-
expect(csv[7]).to eq(
|
20
|
-
expect(csv[8]).to eq(
|
21
|
-
expect(csv[9]).to eq(
|
12
|
+
expect(csv[0]).to eq('10.7554/elife.01567')
|
13
|
+
expect(csv[1]).to eq('https://elifesciences.org/articles/01567')
|
14
|
+
expect(csv[2]).to eq('2018-08-23')
|
15
|
+
expect(csv[3]).to eq('findable')
|
16
|
+
expect(csv[4]).to eq('JournalArticle')
|
17
|
+
expect(csv[5]).to eq('JournalArticle')
|
18
|
+
expect(csv[6]).to eq('Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth')
|
19
|
+
expect(csv[7]).to eq('Sankar, Martial and Nieminen, Kaisa and Ragni, Laura and Xenarios, Ioannis and Hardtke, Christian S')
|
20
|
+
expect(csv[8]).to eq('eLife Sciences Publications, Ltd')
|
21
|
+
expect(csv[9]).to eq('2014')
|
22
22
|
end
|
23
23
|
|
24
|
-
it
|
25
|
-
input =
|
26
|
-
subject =
|
27
|
-
csv =
|
24
|
+
it 'with pages' do
|
25
|
+
input = 'https://doi.org/10.1155/2012/291294'
|
26
|
+
subject = described_class.new(input: input, from: 'crossref')
|
27
|
+
csv = subject.csv.parse_csv
|
28
28
|
|
29
|
-
expect(csv[0]).to eq(
|
30
|
-
expect(csv[1]).to eq(
|
31
|
-
expect(csv[2]).to eq(
|
32
|
-
expect(csv[3]).to eq(
|
33
|
-
expect(csv[4]).to eq(
|
34
|
-
expect(csv[5]).to eq(
|
35
|
-
expect(csv[6]).to eq(
|
36
|
-
expect(csv[7]).to eq(
|
37
|
-
expect(csv[8]).to eq(
|
38
|
-
expect(csv[9]).to eq(
|
29
|
+
expect(csv[0]).to eq('10.1155/2012/291294')
|
30
|
+
expect(csv[1]).to eq('http://www.hindawi.com/journals/pm/2012/291294/')
|
31
|
+
expect(csv[2]).to eq('2016-08-02')
|
32
|
+
expect(csv[3]).to eq('findable')
|
33
|
+
expect(csv[4]).to eq('JournalArticle')
|
34
|
+
expect(csv[5]).to eq('JournalArticle')
|
35
|
+
expect(csv[6]).to eq('Delineating a Retesting Zone Using Receiver Operating Characteristic Analysis on Serial QuantiFERON Tuberculosis Test Results in US Healthcare Workers')
|
36
|
+
expect(csv[7]).to eq('Thanassi, Wendy and Noda, Art and Hernandez, Beatriz and Newell, Jeffery and Terpeluk, Paul and Marder, David and Yesavage, Jerome A.')
|
37
|
+
expect(csv[8]).to eq('Hindawi Limited')
|
38
|
+
expect(csv[9]).to eq('2012')
|
39
39
|
end
|
40
40
|
|
41
|
-
it
|
42
|
-
input =
|
43
|
-
subject =
|
41
|
+
it 'text' do
|
42
|
+
input = 'https://doi.org/10.3204/desy-2014-01645'
|
43
|
+
subject = described_class.new(input: input, from: 'datacite')
|
44
44
|
|
45
45
|
expect(subject.valid?).to be true
|
46
|
-
csv =
|
46
|
+
csv = subject.csv.parse_csv
|
47
47
|
|
48
|
-
expect(csv[0]).to eq(
|
49
|
-
expect(csv[1]).to eq(
|
50
|
-
expect(csv[2]).to eq(
|
51
|
-
expect(csv[3]).to eq(
|
52
|
-
expect(csv[4]).to eq(
|
53
|
-
expect(csv[5]).to eq(
|
54
|
-
expect(csv[6]).to eq(
|
55
|
-
expect(csv[7]).to eq(
|
56
|
-
expect(csv[9]).to eq(
|
48
|
+
expect(csv[0]).to eq('10.3204/desy-2014-01645')
|
49
|
+
expect(csv[1]).to eq('http://bib-pubdb1.desy.de/record/166827')
|
50
|
+
expect(csv[2]).to eq('2018-01-25')
|
51
|
+
expect(csv[3]).to eq('findable')
|
52
|
+
expect(csv[4]).to eq('Text')
|
53
|
+
expect(csv[5]).to eq('Dissertation')
|
54
|
+
expect(csv[6]).to eq('Dynamics of colloids in molecular glass forming liquids studied via X-ray photon correlation spectroscopy')
|
55
|
+
expect(csv[7]).to eq('Conrad, Heiko')
|
56
|
+
expect(csv[9]).to eq('2014')
|
57
57
|
end
|
58
58
|
|
59
|
-
it
|
60
|
-
input =
|
61
|
-
subject =
|
59
|
+
it 'climate data' do
|
60
|
+
input = 'https://doi.org/10.5067/altcy-tj122'
|
61
|
+
subject = described_class.new(input: input, from: 'datacite')
|
62
62
|
expect(subject.valid?).to be true
|
63
|
-
csv =
|
63
|
+
csv = subject.csv.parse_csv
|
64
64
|
|
65
|
-
expect(csv[0]).to eq(
|
66
|
-
expect(csv[1]).to eq(
|
67
|
-
expect(csv[2]).to eq(
|
68
|
-
expect(csv[3]).to eq(
|
69
|
-
expect(csv[4]).to eq(
|
70
|
-
expect(csv[5]).to eq(
|
71
|
-
expect(csv[6]).to eq(
|
72
|
-
expect(csv[7]).to eq(
|
73
|
-
expect(csv[8]).to eq(
|
74
|
-
expect(csv[9]).to eq(
|
65
|
+
expect(csv[0]).to eq('10.5067/altcy-tj122')
|
66
|
+
expect(csv[1]).to eq('http://podaac.jpl.nasa.gov/dataset/MERGED_TP_J1_OSTM_OST_CYCLES_V2')
|
67
|
+
expect(csv[2]).to eq('2014-01-15')
|
68
|
+
expect(csv[3]).to eq('findable')
|
69
|
+
expect(csv[4]).to eq('Dataset')
|
70
|
+
expect(csv[5]).to eq('Dataset')
|
71
|
+
expect(csv[6]).to eq('Integrated Multi-Mission Ocean Altimeter Data for Climate Research Version 2')
|
72
|
+
expect(csv[7]).to eq('{GSFC}')
|
73
|
+
expect(csv[8]).to eq('NASA Physical Oceanography DAAC')
|
74
|
+
expect(csv[9]).to eq('2012')
|
75
75
|
end
|
76
76
|
|
77
|
-
it
|
78
|
-
input =
|
79
|
-
subject =
|
80
|
-
csv =
|
77
|
+
it 'maremma' do
|
78
|
+
input = 'https://github.com/datacite/maremma'
|
79
|
+
subject = described_class.new(input: input, from: 'codemeta')
|
80
|
+
csv = subject.csv.parse_csv
|
81
81
|
|
82
|
-
expect(csv[0]).to eq(
|
83
|
-
expect(csv[1]).to eq(
|
84
|
-
expect(csv[2]).to
|
85
|
-
expect(csv[3]).to eq(
|
86
|
-
expect(csv[4]).to eq(
|
87
|
-
expect(csv[5]).to
|
88
|
-
expect(csv[6]).to eq(
|
89
|
-
expect(csv[7]).to eq(
|
90
|
-
expect(csv[8]).to eq(
|
91
|
-
expect(csv[9]).to eq(
|
82
|
+
expect(csv[0]).to eq('10.5438/qeg0-3gm3')
|
83
|
+
expect(csv[1]).to eq('https://github.com/datacite/maremma')
|
84
|
+
expect(csv[2].nil?).to be(true)
|
85
|
+
expect(csv[3]).to eq('findable')
|
86
|
+
expect(csv[4]).to eq('Software')
|
87
|
+
expect(csv[5].nil?).to be(true)
|
88
|
+
expect(csv[6]).to eq('Maremma: a Ruby library for simplified network calls')
|
89
|
+
expect(csv[7]).to eq('Fenner, Martin')
|
90
|
+
expect(csv[8]).to eq('DataCite')
|
91
|
+
expect(csv[9]).to eq('2017')
|
92
92
|
end
|
93
93
|
end
|
94
94
|
end
|
@@ -3,94 +3,104 @@
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
5
|
describe Briard::Metadata, vcr: true do
|
6
|
-
context
|
7
|
-
it
|
8
|
-
input =
|
9
|
-
subject =
|
6
|
+
context 'write metadata as datacite json' do
|
7
|
+
it 'with data citation' do
|
8
|
+
input = '10.7554/eLife.01567'
|
9
|
+
subject = described_class.new(input: input, from: 'crossref')
|
10
10
|
datacite = JSON.parse(subject.datacite_json)
|
11
|
-
expect(datacite.fetch(
|
12
|
-
expect(datacite.fetch(
|
13
|
-
|
14
|
-
expect(datacite.fetch(
|
15
|
-
expect(datacite.fetch(
|
16
|
-
expect(datacite.fetch(
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
11
|
+
expect(datacite.fetch('url')).to eq('https://elifesciences.org/articles/01567')
|
12
|
+
expect(datacite.fetch('types')).to eq('bibtex' => 'article', 'citeproc' => 'article-journal',
|
13
|
+
'resourceType' => 'JournalArticle', 'resourceTypeGeneral' => 'JournalArticle', 'ris' => 'JOUR', 'schemaOrg' => 'ScholarlyArticle')
|
14
|
+
expect(datacite.fetch('titles')).to eq([{ 'title' => 'Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth' }])
|
15
|
+
expect(datacite.fetch('relatedIdentifiers').length).to eq(28)
|
16
|
+
expect(datacite.fetch('relatedIdentifiers').first).to eq('relatedIdentifier' => '2050-084X',
|
17
|
+
'relatedIdentifierType' => 'ISSN', 'relationType' => 'IsPartOf', 'resourceTypeGeneral' => 'Collection')
|
18
|
+
expect(datacite.fetch('rightsList')).to eq([{ 'rights' => 'Creative Commons Attribution 3.0 Unported',
|
19
|
+
'rightsIdentifier' => 'cc-by-3.0',
|
20
|
+
'rightsIdentifierScheme' => 'SPDX',
|
21
|
+
'rightsUri' => 'https://creativecommons.org/licenses/by/3.0/legalcode',
|
22
|
+
'schemeUri' => 'https://spdx.org/licenses/' }])
|
21
23
|
end
|
22
24
|
|
23
|
-
it
|
24
|
-
input =
|
25
|
-
subject =
|
25
|
+
it 'with ORCID ID' do
|
26
|
+
input = 'https://doi.org/10.1155/2012/291294'
|
27
|
+
subject = described_class.new(input: input, from: 'crossref')
|
26
28
|
datacite = JSON.parse(subject.datacite_json)
|
27
|
-
expect(datacite.fetch(
|
28
|
-
expect(datacite.fetch(
|
29
|
-
|
30
|
-
expect(datacite.fetch(
|
29
|
+
expect(datacite.fetch('url')).to eq('http://www.hindawi.com/journals/pm/2012/291294/')
|
30
|
+
expect(datacite.fetch('types')).to eq('bibtex' => 'article', 'citeproc' => 'article-journal',
|
31
|
+
'resourceType' => 'JournalArticle', 'resourceTypeGeneral' => 'JournalArticle', 'ris' => 'JOUR', 'schemaOrg' => 'ScholarlyArticle')
|
32
|
+
expect(datacite.fetch('creators').length).to eq(7)
|
33
|
+
expect(datacite.fetch('creators').first).to eq('nameType' => 'Personal',
|
34
|
+
'name' => 'Thanassi, Wendy', 'givenName' => 'Wendy', 'familyName' => 'Thanassi', 'affiliation' => [{ 'name' => 'Department of Medicine, Veterans Affairs Palo Alto Health Care System, 3801 Miranda Avenue MC-, Palo Alto, CA 94304-1207, USA' }, { 'name' => 'Occupational Health Strategic Health Care Group, Office of Public Health, Veterans Health Administration, Washington, DC 20006, USA' }, { 'name' => 'Division of Emergency Medicine, Stanford University School of Medicine, Stanford, CA 94304, USA' }, { 'name' => 'War Related Illness and Injury Study Center (WRIISC) and Mental Illness Research Education and Clinical Center (MIRECC), Department of Veterans Affairs, Palo Alto, CA 94304, USA' }])
|
31
35
|
end
|
32
36
|
|
33
|
-
it
|
34
|
-
input = fixture_path
|
35
|
-
subject =
|
37
|
+
it 'Crossref DOI' do
|
38
|
+
input = "#{fixture_path}crossref.bib"
|
39
|
+
subject = described_class.new(input: input, from: 'bibtex')
|
36
40
|
datacite = JSON.parse(subject.datacite_json)
|
37
|
-
expect(datacite.fetch(
|
38
|
-
|
39
|
-
expect(datacite.
|
40
|
-
expect(datacite.
|
41
|
-
|
41
|
+
expect(datacite.fetch('types')).to eq('bibtex' => 'article', 'citeproc' => 'article-journal',
|
42
|
+
'resourceType' => 'JournalArticle', 'resourceTypeGeneral' => 'JournalArticle', 'ris' => 'JOUR', 'schemaOrg' => 'ScholarlyArticle')
|
43
|
+
expect(datacite.fetch('titles')).to eq([{ 'title' => 'Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth' }])
|
44
|
+
expect(datacite.dig('descriptions', 0,
|
45
|
+
'description')).to start_with('Among various advantages, their small size makes model organisms preferred subjects of investigation.')
|
46
|
+
expect(datacite.fetch('creators').length).to eq(5)
|
47
|
+
expect(datacite.fetch('creators').first).to eq('nameType' => 'Personal',
|
48
|
+
'name' => 'Sankar, Martial', 'givenName' => 'Martial', 'familyName' => 'Sankar')
|
42
49
|
end
|
43
50
|
|
44
|
-
it
|
45
|
-
input = fixture_path
|
46
|
-
subject =
|
51
|
+
it 'BlogPosting Citeproc JSON' do
|
52
|
+
input = "#{fixture_path}citeproc.json"
|
53
|
+
subject = described_class.new(input: input, from: 'citeproc')
|
47
54
|
datacite = JSON.parse(subject.datacite_json)
|
48
|
-
expect(datacite.fetch(
|
49
|
-
|
50
|
-
expect(datacite.
|
51
|
-
expect(datacite.
|
55
|
+
expect(datacite.fetch('types')).to eq('bibtex' => 'article', 'citeproc' => 'post-weblog',
|
56
|
+
'resourceTypeGeneral' => 'Text', 'ris' => 'GEN', 'schemaOrg' => 'BlogPosting')
|
57
|
+
expect(datacite.fetch('titles')).to eq([{ 'title' => 'Eating your own Dog Food' }])
|
58
|
+
expect(datacite.dig('descriptions', 0,
|
59
|
+
'description')).to start_with('Eating your own dog food')
|
60
|
+
expect(datacite.fetch('creators')).to eq([{ 'familyName' => 'Fenner', 'givenName' => 'Martin',
|
61
|
+
'name' => 'Fenner, Martin' }])
|
52
62
|
end
|
53
63
|
|
54
|
-
it
|
55
|
-
input = fixture_path
|
56
|
-
subject =
|
64
|
+
it 'rdataone' do
|
65
|
+
input = "#{fixture_path}codemeta.json"
|
66
|
+
subject = described_class.new(input: input, from: 'codemeta')
|
57
67
|
datacite = JSON.parse(subject.datacite_json)
|
58
|
-
expect(datacite.fetch(
|
59
|
-
expect(datacite.fetch(
|
60
|
-
expect(datacite.fetch(
|
61
|
-
|
62
|
-
expect(datacite.fetch(
|
68
|
+
expect(datacite.fetch('titles')).to eq([{ 'title' => 'R Interface to the DataONE REST API' }])
|
69
|
+
expect(datacite.fetch('creators').length).to eq(3)
|
70
|
+
expect(datacite.fetch('creators').first).to eq('affiliation' => [{ 'name' => 'NCEAS' }], 'nameType' => 'Personal', 'name' => 'Jones, Matt',
|
71
|
+
'nameIdentifiers' => [{ 'nameIdentifier' => 'https://orcid.org/0000-0003-0077-4738', 'nameIdentifierScheme' => 'ORCID', 'schemeUri' => 'https://orcid.org' }], 'givenName' => 'Matt', 'familyName' => 'Jones')
|
72
|
+
expect(datacite.fetch('version')).to eq('2.0.0')
|
63
73
|
end
|
64
74
|
|
65
|
-
it
|
66
|
-
input =
|
67
|
-
subject =
|
75
|
+
it 'maremma' do
|
76
|
+
input = 'https://github.com/datacite/maremma'
|
77
|
+
subject = described_class.new(input: input, from: 'codemeta')
|
68
78
|
datacite = JSON.parse(subject.datacite_json)
|
69
|
-
expect(datacite.fetch(
|
70
|
-
expect(datacite.fetch(
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
[{
|
76
|
-
|
77
|
-
|
79
|
+
expect(datacite.fetch('titles')).to eq([{ 'title' => 'Maremma: a Ruby library for simplified network calls' }])
|
80
|
+
expect(datacite.fetch('creators')).to eq([{ 'affiliation' => [{ 'name' => 'DataCite' }],
|
81
|
+
'familyName' => 'Fenner',
|
82
|
+
'givenName' => 'Martin',
|
83
|
+
'name' => 'Fenner, Martin',
|
84
|
+
'nameIdentifiers' =>
|
85
|
+
[{ 'nameIdentifier' => 'https://orcid.org/0000-0003-0077-4738',
|
86
|
+
'nameIdentifierScheme' => 'ORCID', 'schemeUri' => 'https://orcid.org' }],
|
87
|
+
'nameType' => 'Personal' }])
|
78
88
|
end
|
79
89
|
|
80
|
-
it
|
81
|
-
input =
|
82
|
-
subject =
|
90
|
+
it 'from schema.org' do
|
91
|
+
input = 'https://blog.front-matter.io/posts/eating-your-own-dog-food/'
|
92
|
+
subject = described_class.new(input: input, from: 'schema_org')
|
83
93
|
expect(subject.valid?).to be true
|
84
94
|
datacite = JSON.parse(subject.datacite_json)
|
85
|
-
expect(datacite.fetch(
|
86
|
-
expect(datacite.fetch(
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
[{
|
92
|
-
|
93
|
-
|
95
|
+
expect(datacite.fetch('titles')).to eq([{ 'title' => 'Eating your own Dog Food' }])
|
96
|
+
expect(datacite.fetch('creators')).to eq([{ 'affiliation' => [],
|
97
|
+
'familyName' => 'Fenner',
|
98
|
+
'givenName' => 'Martin',
|
99
|
+
'name' => 'Fenner, Martin',
|
100
|
+
'nameIdentifiers' =>
|
101
|
+
[{ 'nameIdentifier' => 'https://orcid.org/0000-0003-1419-2405',
|
102
|
+
'nameIdentifierScheme' => 'ORCID', 'schemeUri' => 'https://orcid.org' }],
|
103
|
+
'nameType' => 'Personal' }])
|
94
104
|
end
|
95
105
|
end
|
96
106
|
end
|