require "spec_helper" RSpec.describe IsoDoc do it "processes amend blocks" do input = <<~INPUT Document title en published 2020 article Change Clause 2 A.7

This table contains information on polygon cells which are not included in ISO 10303-52. Remove table 2 completely and replace with:

Edges of triangle and quadrilateral cells
triangle quadrilateral
edge vertices edge vertices
1 1, 2 1 1, 2
2 2, 3 2 2, 3
3 3, 1 3 3, 4
4 4, 1
Figure

This is not generalised further.

INPUT presxml = <<~OUTPUT Document title en published 2020 article 1.<tab/>Change Clause

This table contains information on polygon cells which are not included in ISO 10303-52. Remove table 2 completely and replace with:

Table 2 — Edges of triangle and quadrilateral cells
triangle quadrilateral
edge vertices edge vertices
1 1, 2 1 1, 2
2 2, 3 2 2, 3
3 3, 1 3 3, 4
4 4, 1
Figure
EXAMPLE A.7

This is not generalised further.

OUTPUT html = <<~OUTPUT

 


 


Document title

1.  Change Clause

This table contains information on polygon cells which are not included in ISO 10303-52. Remove table 2 completely and replace with:

Table 2 — Edges of triangle and quadrilateral cells

triangle quadrilateral
edge vertices edge vertices
1 1, 2 1 1, 2
2 2, 3 2 2, 3
3 3, 1 3 3, 4
4 4, 1

Figure

EXAMPLE A.7

This is not generalised further.

OUTPUT expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}) .convert("test", input, true)) .sub(%r{.*}m, "")) .to be_equivalent_to xmlpp(presxml) expect(xmlpp(IsoDoc::HtmlConvert.new({}) .convert("test", presxml, true))).to be_equivalent_to xmlpp(html) end it "processes unlabelled notes" do input = <<~INPUT

These results are based on a study carried out on three different types of kernel.

INPUT presxml = <<~OUTPUT NOTE

These results are based on a study carried out on three different types of kernel.

OUTPUT html = <<~OUTPUT #{HTML_HDR}

Foreword

NOTE  These results are based on a study carried out on three different types of kernel.

OUTPUT doc = <<~OUTPUT

 



Foreword

Figure 1

 


DOC expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}) .convert("test", input, true) .gsub(/</, "<"))).to be_equivalent_to xmlpp(presxml) expect(xmlpp(strip_guid(IsoDoc::HtmlConvert.new({}) .convert("test", presxml, true)))).to be_equivalent_to xmlpp(html) expect(xmlpp(strip_guid(IsoDoc::WordConvert.new({}) .convert("test", presxml, true) .gsub(/['"][^'".]+(?
INPUT output = <<~OUTPUT

 



Foreword

 


OUTPUT expect(xmlpp(strip_guid(IsoDoc::WordConvert.new({}) .convert("test", input, true) .gsub(/['"][^'".]+(?
INPUT output = <<~OUTPUT

 



Foreword

 


OUTPUT expect(xmlpp(strip_guid(IsoDoc::WordConvert.new({}) .convert("test", input, true) .gsub(/['"][^'".]+(? Title

Hello

Sample
INPUT presxml = <<~OUTPUT EXAMPLE — Title

Hello

Sample
OUTPUT html = <<~OUTPUT #{HTML_HDR}

Foreword

EXAMPLE — Title

Hello

          
         
       

Sample

OUTPUT doc = <<~OUTPUT

 



Foreword

EXAMPLE — Title

Hello


         
       

Sample

 


OUTPUT expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}) .convert("test", input, true))).to be_equivalent_to xmlpp(presxml) expect(xmlpp(IsoDoc::HtmlConvert.new({}) .convert("test", presxml, true))).to be_equivalent_to xmlpp(html) expect(xmlpp(IsoDoc::WordConvert.new({}) .convert("test", presxml, true))).to be_equivalent_to xmlpp(doc) end it "processes sequences of examples" do input = <<~INPUT

Hello

Title

Hello

Hello

INPUT output = <<~OUTPUT EXAMPLE 1

Hello

EXAMPLE 2 — Title

Hello

EXAMPLE

Hello

OUTPUT expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}) .convert("test", input, true))).to be_equivalent_to xmlpp(output) end it "processes sourcecode" do input = <<~INPUT Ruby code puts x Que? INPUT presxml = <<~OUTPUT Figure 1 — Ruby code puts x Que? OUTPUT html = <<~OUTPUT #{HTML_HDR}

Foreword


       
         puts x
     

Figure 1 — Ruby code

 Que? 

OUTPUT doc = <<~OUTPUT

 



Foreword

(#(r = 1 %)#)  

where

(#(r)#)

is the repeatability limit.

NOTE   [durationUnits] is essentially a duration statement without the "P" prefix. "P" is unnecessary because between "G" and "U" duration is always expressed.

(#(r = 1 %)#)   (1)

 


OUTPUT expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}) .convert("test", input, true))).to be_equivalent_to xmlpp(presxml) expect(xmlpp(IsoDoc::HtmlConvert.new({}) .convert("test", presxml, true))).to be_equivalent_to xmlpp(html) expect(xmlpp(IsoDoc::WordConvert.new({}) .convert("test", presxml, true))).to be_equivalent_to xmlpp(word) end it "processes paragraph attributes" do input = <<~INPUT

Vache Equipment
Fictitious
World

Justify

INPUT html = <<~OUTPUT #{HTML_HDR}

Foreword

Vache Equipment
Fictitious
World

Justify

OUTPUT word = <<~OUTPUT