require "spec_helper" RSpec.describe IsoDoc do it "processes inline formatting" do expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT"

A B C D E F G


INPUT test

 



Foreword

A B C D E F G



 


OUTPUT end it "processes links" do expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT"

example

INPUT test

 



Foreword

http://example.com example

 


OUTPUT end it "processes unrecognised markup" do expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT"

example

INPUT test

 



Foreword

<barry fred="http://example.com">example</barry>

 


OUTPUT end it "processes AsciiMath and MathML" do expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT"

A X Latex?

INPUT test

 



Foreword

(#(A)#) X Latex?

 


OUTPUT end it "overrides AsciiMath delimiters" do expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT"

A (#((Hello))#)

INPUT test

 



Foreword

(#(((A)#))) (#((Hello))#)

 


OUTPUT end it "processes eref types" do expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT"

A A

Normative References Cereals and cereal products ISO 712 ISO
INPUT test

 



Foreword

A A

 


2.  Normative References

The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.

ISO 712, Cereals and cereal products

OUTPUT end it "processes eref content" do expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT"

1 11 11 1 1.5 1A A

Normative References Cereals and cereal products ISO 712 ISO
INPUT test

 



Foreword

ISO 712 ISO 712 ISO 712, Table 1 ISO 712, Table 1–1 ISO 712, Clause 1, Table 1 ISO 712, Clause 1 ISO 712, 1.5 A ISO 712, A

 


2.  Normative References

The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.

ISO 712, Cereals and cereal products

OUTPUT end end