spec/isodoc/metadata_spec.rb in isodoc-1.2.6 vs spec/isodoc/metadata_spec.rb in isodoc-1.2.7
- old
+ new
@@ -16,10 +16,12 @@
<uri type="html">URL B</uri>
<uri type="xml">URL C</uri>
<uri type="pdf">URL D</uri>
<uri type="doc">URL E</uri>
<docidentifier>17301-1</docidentifier>
+ <docidentifier type="ISBN">ISBN 13</docidentifier>
+ <docidentifier type="ISBN10">ISBN 10</docidentifier>
<docnumber>17301</docnumber>
<date type="published"><on>2011</on></date>
<date type="accessed"><on>2012</on></date>
<date type="created"><from>2010</from><to>2011</to></date>
<date type="activated"><on>2013</on></date>
@@ -96,12 +98,10 @@
<keyword>KW3</keyword>
<ext>
<doctype>international-standard</doctype>
</ext>
</bibdata>
- <local_bibdata type="standard">
- </local_bibdata>
</iso-standard>
INPUT
{:accesseddate=>"2012",
:activateddate=>"2013",
:agency=>"ISO",
@@ -114,28 +114,35 @@
:doc=>"URL E",
:docnumber=>"17301-1",
:docnumeric=>"17301",
:doctitle=>"Cereals and pulses",
:doctype=>"International Standard",
+:doctype_display=>"International Standard",
:docyear=>"2016",
:draft=>"0.4",
:draftinfo=>" (draft 0.4, 2016-05-01)",
:edition=>"2",
:html=>"URL B",
:implementeddate=>"XXX",
+:isbn=>"ISBN 13",
+:isbn10=>"ISBN 10",
:issueddate=>"XXX",
:iteration=>"2",
:keywords=>["KW2", "KW1", "KW3"],
+:lang=>"en",
:obsoleteddate=>"2014",
:pdf=>"URL D",
:publisheddate=>"2011",
:receiveddate=>"XXX",
:revdate=>"2016-05-01",
:revdate_monthyear=>"May 2016",
+:script=>"Latn",
:stage=>"Committee Draft",
+:stage_display=>"Committee Draft",
:stageabbr=>"CD",
:substage=>"Withdrawn",
+:substage_display=>"Withdrawn",
:title_footnote=>["A footnote", "Another footnote"],
:transmitteddate=>"2020",
:unchangeddate=>"2019",
:unpublished=>true,
:updateddate=>"2018",
@@ -232,15 +239,17 @@
:createddate=>"XXX",
:docnumber=>"17301-1-3",
:docnumeric=>"17301",
:doctitle=>"Cereals and pulses",
:doctype=>"International Standard",
+:doctype_display=>"International Standard",
:docyear=>"2016",
:draft=>"12",
:draftinfo=>" (draft 12, 2016-05)",
:implementeddate=>"XXX",
:issueddate=>"XXX",
+:lang=>"en",
:obsoleteddate=>"XXX",
:obsoletes=>"IEC 8121",
:obsoletes_part=>"3.1",
:partof=>"IEC 8122",
:pub_address=>"1 Infinity Loop + California",
@@ -251,11 +260,13 @@
:publisheddate=>"2011-01",
:publisher=>"International Organization for Standardization, International Electrotechnical Commission and Institute of Electrical and Electronics Engineers",
:receiveddate=>"XXX",
:revdate=>"2016-05",
:revdate_monthyear=>"May 2016",
+:script=>"Latn",
:stage=>"Published",
+:stage_display=>"Published",
:subdivision=>"Subdivision",
:transmitteddate=>"XXX",
:unchangeddate=>"XXX",
:unpublished=>false,
:updateddate=>"XXX",
@@ -269,10 +280,21 @@
arr = c.convert_init(<<~"INPUT", "test", false)
<iso-standard xmlns="http://riboseinc.com/isoxml">
<bibdata type="standard">
<language>fr</language>
<script>Latn</script>
+ <status>
+ <stage lang="">Committee Draft</stage>
+ <stage lang=fr">Projet de comité</stage>
+ <substage lang="">Withdrawn</substage>
+ <substage lang="fr">Rétiré</substage>
+ <iteration>2</iteration>
+ </status>
+<ext>
+<doctype lang="">international-standard</doctype>
+<doctype lang="fr">Standard international</doctype>
+</ext>
</bibdata>
</iso-standard>
INPUT
expect(metadata(c.info(Nokogiri::XML(<<~"INPUT"), nil))).to be_equivalent_to <<~"OUTPUT"
<iso-standard xmlns="http://riboseinc.com/isoxml">
@@ -305,19 +327,29 @@
<abbreviation>IEC</abbreviation>
</organization>
</contributor>
<language>fr</language>
<script>Latn</script>
- <status><stage>Published</stage></status>
+ <status>
+ <stage language="">Committee Draft</stage>
+ <stage language="fr">Projet de comité</stage>
+ <substage language="">Withdrawn</substage>
+ <substage language="fr">Rétiré</substage>
+ <iteration>2</iteration>
+ </status>
<copyright>
<from>2016</from>
<owner>
<organization>
<name>International Organization for Standardization</name>
</organization>
</owner>
</copyright>
+<ext>
+<doctype language="">international-standard</doctype>
+<doctype language="fr">Standard international</doctype>
+</ext>
</bibdata>
</iso-standard>
INPUT
{:accesseddate=>"XXX",
:agency=>"ISO/IEC",
@@ -325,23 +357,32 @@
:confirmeddate=>"XXX",
:copieddate=>"XXX",
:createddate=>"XXX",
:docnumber=>"17301-1-3",
:docnumeric=>"17301",
-:doctitle=>"Cereals and pulses",
+:doctitle=>"Céréales et légumineuses",
+:doctype=>"International Standard",
+:doctype_display=>"Standard International",
:docyear=>"2016",
:implementeddate=>"XXX",
:issueddate=>"XXX",
+:iteration=>"2",
+:lang=>"fr",
:obsoleteddate=>"XXX",
:publisheddate=>"2011-01",
:publisher=>"International Organization for Standardization et International Electrotechnical Commission",
:receiveddate=>"XXX",
:revdate=>"2016-05",
:revdate_monthyear=>"Mai 2016",
-:stage=>"Published",
+:script=>"Latn",
+:stage=>"Committee Draft",
+:stage_display=>"Projet De Comité",
+:stageabbr=>"CD",
+:substage=>"Withdrawn",
+:substage_display=>"Rétiré",
:transmitteddate=>"XXX",
:unchangeddate=>"XXX",
-:unpublished=>false,
+:unpublished=>true,
:updateddate=>"XXX",
:vote_endeddate=>"XXX",
:vote_starteddate=>"XXX"}
OUTPUT
end