Skip to content

Commit

Permalink
localised bibdata: metanorma/metanorma-bipm#29
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis committed Oct 22, 2020
1 parent 78a8f9b commit 2a78670
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
15 changes: 4 additions & 11 deletions spec/isodoc/html_convert_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
:docnumeric=>"1000",
:doctitle=>"Main Title",
:doctype=>"Standard",
:doctype_display=>"Standard",
:docyear=>"2001",
:draft=>"3.4",
:draftinfo=>" (draft 3.4, 2000-01-01)",
Expand All @@ -97,6 +98,7 @@
:series=>"Bathymetric",
:seriesabbr=>"B",
:stage=>"Working Draft",
:stage_display=>"Working Draft",
:tc=>"TC",
:transmitteddate=>"XXX",
:unchangeddate=>"XXX",
Expand Down Expand Up @@ -339,21 +341,12 @@
<bibdata type="standard">
<title language="en" format="text/plain" type="main">An ITU Standard</title>
<docidentifier type="ITU">12345</docidentifier>
<language>en</language>
<language current="true">en</language>
<keyword>A</keyword>
<keyword>B</keyword>
<ext>
</ext>
</bibdata>
<local_bibdata type="standard">
<title language="en" format="text/plain" type="main">An ITU Standard</title>
<docidentifier type="ITU">12345</docidentifier>
<language>en</language>
<keyword>A</keyword>
<keyword>B</keyword>
<ext>
</ext>
</local_bibdata>
<preface>
<abstract>
<title>Abstract</title>
Expand Down Expand Up @@ -557,7 +550,7 @@
</body>
OUTPUT
expect(xmlpp(IsoDoc::IHO::PresentationXMLConvert.new({}).convert("test", input, true).sub(%r{<i18nyaml>.*</i18nyaml>}m, ""))).to be_equivalent_to xmlpp(presxml)
expect(xmlpp(IsoDoc::IHO::PresentationXMLConvert.new({}).convert("test", input, true).sub(%r{<localized-strings>.*</localized-strings>}m, ""))).to be_equivalent_to xmlpp(presxml)
expect(xmlpp(IsoDoc::IHO::HtmlConvert.new({}).convert("test", presxml, true).gsub(%r{^.*<body}m, "<body").gsub(%r{</body>.*}m, "</body>"))).to be_equivalent_to xmlpp(html)
end

Expand Down
7 changes: 2 additions & 5 deletions spec/isodoc/ref_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,8 @@
<?xml version='1.0'?>
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
<bibdata>
<language>en</language>
<language current="true">en</language>
</bibdata>
<local_bibdata>
<language>en</language>
</local_bibdata>
<preface><foreword>
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">
<eref bibitemid="ref1">S-57</eref>
Expand Down Expand Up @@ -451,7 +448,7 @@
</div>
</body>
OUTPUT
expect(xmlpp(IsoDoc::IHO::PresentationXMLConvert.new({}).convert("test", input, true).sub(%r{<i18nyaml>.*</i18nyaml>}m, ""))).to be_equivalent_to xmlpp(presxml)
expect(xmlpp(IsoDoc::IHO::PresentationXMLConvert.new({}).convert("test", input, true).sub(%r{<localized-strings>.*</localized-strings>}m, ""))).to be_equivalent_to xmlpp(presxml)
expect(xmlpp(IsoDoc::IHO::HtmlConvert.new({}).convert("test", presxml, true).gsub(%r{^.*<body}m, "<body").gsub(%r{</body>.*}m, "</body>"))).to be_equivalent_to xmlpp(html)
end

Expand Down

0 comments on commit 2a78670

Please sign in to comment.