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

This is a preamble

Introduction Introduction Subsection

This is patent boilerplate

Scope

Text

Terms, Definitions, Symbols and Abbreviated Terms Normal Terms Term2
Symbol
Definition
Symbol
Definition
Clause 4 Introduction Clause 4.2
Annex Annex A.1 Annex A.1a An Appendix Normative References Bibliography Bibliography Subsection
INPUT #{HTML_HDR}

Foreword

This is a preamble


0.  Introduction

0.1. Introduction Subsection

This is patent boilerplate

1.  Scope

Text

2.  Normative References

There are no normative references in this document.

3.  Terms and Definitions

For the purposes of this document, the following terms and definitions apply.

ISO and IEC maintain terminological databases for use in standardization at the following addresses:

3.1. Normal Terms

3.1.1

Term2

3.2. Symbols and Abbreviated Terms

Symbol

Definition

4.  Symbols and Abbreviated Terms

Symbol

Definition

5.  Clause 4

5.1. Introduction

5.2. Clause 4.2


Annex A
(normative)

Annex

A.1. Annex A.1

A.1.1. Annex A.1a

Appendix 1. An Appendix


Bibliography

Bibliography Subsection

OUTPUT end it "processes section names (Word)" do expect(IsoDoc::WordConvert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT" Foreword

This is a preamble

Introduction Introduction Subsection

This is patent boilerplate

Scope

Text

Terms, Definitions, Symbols and Abbreviated Terms Normal Terms Term2
Symbol
Definition
Symbol
Definition
Clause 4 Introduction Clause 4.2
Annex Annex A.1 Annex A.1a An Appendix Normative References Bibliography Bibliography Subsection
INPUT test

 



Foreword

This is a preamble


0.  Introduction

0.1. Introduction Subsection

This is patent boilerplate

 


1.  Scope

Text

2.  Normative References

There are no normative references in this document.

3.  Terms and Definitions

For the purposes of this document, the following terms and definitions apply.

ISO and IEC maintain terminological databases for use in standardization at the following addresses:

3.1. Normal Terms

3.1.1

Term2

3.2. Symbols and Abbreviated Terms

Symbol

Definition

4.  Symbols and Abbreviated Terms

Symbol

Definition

5.  Clause 4

5.1. Introduction

5.2. Clause 4.2


Annex A
(normative)

Annex

A.1. Annex A.1

A.1.1. Annex A.1a

Appendix 1. An Appendix


Bibliography

Bibliography Subsection

OUTPUT end it "processes simple terms & definitions" do expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT" Terms, Definitions, Symbols and Abbreviated Terms Term2 INPUT test

 


 


1.  Terms and Definitions

For the purposes of this document, the following terms and definitions apply.

ISO and IEC maintain terminological databases for use in standardization at the following addresses:

1.1

Term2

OUTPUT end it "processes terms & definitions with external source" do expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT" Terms, Definitions, Symbols and Abbreviated Terms Term2 Normative References Cereals and cereal products?~@~I?~@~T?~@~IDetermination of moisture content?~@~I?~@~T?~@~IReference method ISO 712 International Organization for Standardization INPUT test

 


 


1.  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?~@~I?~@~T?~@~IDetermination of moisture content?~@~I?~@~T?~@~IReference method

2.  Terms and Definitions

For the purposes of this document, the terms and definitions given in ISO 712 and the following apply.

ISO and IEC maintain terminological databases for use in standardization at the following addresses:

2.1

Term2

OUTPUT end it "processes empty terms & definitions with external source" do expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT" Terms, Definitions, Symbols and Abbreviated Terms Normative References Cereals and cereal products?~@~I?~@~T?~@~IDetermination of moisture content?~@~I?~@~T?~@~IReference method ISO 712 ISO INPUT test

 


 


1.  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?~@~I?~@~T?~@~IDetermination of moisture content?~@~I?~@~T?~@~IReference method

2.  Terms and Definitions

For the purposes of this document, the terms and definitions given in ISO 712, ISO 712 and ISO 712 apply.

ISO and IEC maintain terminological databases for use in standardization at the following addresses:

OUTPUT end it "processes empty terms & definitions" do expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT" Terms, Definitions, Symbols and Abbreviated Terms INPUT test

 


 


1.  Terms and Definitions

No terms and definitions are listed in this document.

ISO and IEC maintain terminological databases for use in standardization at the following addresses:

OUTPUT end it "processes inline section headers" do expect(IsoDoc::Convert.new({}).convert_file(<<~"INPUT", "test", true)).to be_equivalent_to <<~"OUTPUT" Clause 4 Introduction Clause 4.2 INPUT test

 


 


1.  Clause 4

1.1. Introduction

1.2. Clause 4.2
OUTPUT end end