require "spec_helper" RSpec.describe IsoDoc do it "processes IsoXML tables" do input = <<~INPUT Repeatability and reproducibility of husked rice yield

X

Drago
A type of rice

This is a table about rice

Description Rice sample
Arborio Drago

Parboiled rice.

Balilla

Parboiled rice.

Thaibonnet
Number of laboratories retained after eliminating outliers 13 11 13 13
Mean value, g/100 g 81,2 82,0 81,8 77,7
Reproducibility limit, R (= 2,83 s_R) 2,89 0,57 2,26 6,06
A
INPUT presxml = <<~OUTPUT Table 1 — Repeatability and reproducibility of husked rice yield

X

Drago
A type of rice
NOTE

This is a table about rice

Description Rice sample
Arborio Drago

Parboiled rice.

Balilla

Parboiled rice.

Thaibonnet
Number of laboratories retained after eliminating outliers 13 11 13 13
Mean value, g/100 g 81,2 82,0 81,8 77,7
Reproducibility limit, R (= 2,83 s_R ) 2,89 0,57 2,26 6,06
A
OUTPUT html = <<~OUTPUT #{HTML_HDR}

Foreword

Table 1 — Repeatability and reproducibility of husked rice yield 1

Drago

A type of rice

NOTE  This is a table about rice

long desc
Description Rice sample
Arborio Dragoa Balillaa Thaibonnet
Number of laboratories retained after eliminating outliers 13 11 13 13
Mean value, g/100 g 81,2 82,0 81,8 77,7
Reproducibility limit, (#(R)#) (= 2,83 (#(s_R)#)) 2,89 0,57 2,26 6,06
A

OUTPUT word = <<~OUTPUT

 



Foreword

Repeatability and reproducibility of husked rice yield 1

Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Description Rice sample

 


OUTPUT expect(xmlpp(IsoDoc::WordConvert.new({}) .convert("test", input, true) .gsub(/mso-bookmark:_Ref\d+/, "mso-bookmark:_Ref"))) .to be_equivalent_to xmlpp(output) end end