require "spec_helper" RSpec.describe IsoDoc do it "processes prefatory blocks" do input = <<~INPUT abstract introduction note Clause 4 Introduction Clause 4.2

admonition

INPUT expect(xmlpp(IsoDoc::HtmlConvert.new({}) .convert("test", input, true))).to be_equivalent_to xmlpp(<<~"OUTPUT")

 


 


note

abstract


introduction

CAUTION

admonition

Clause 4

Introduction

Clause 4.2 
OUTPUT expect(xmlpp(IsoDoc::WordConvert.new({}) .convert("test", input, true))).to be_equivalent_to xmlpp(<<~"OUTPUT")

 


 

note


abstract


introduction

 


CAUTION

admonition

Clause 4

Introduction

Clause 4.2  
OUTPUT end it "processes document with no content" do expect(xmlpp(IsoDoc::HtmlConvert.new({}) .convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT") INPUT

 


 


OUTPUT end it "processes section names" do input = <<~"INPUT" Copyright License Legal Feedback Abstract Foreword

This is a preamble

Introduction Introduction Subsection Dedication Note to reader Acknowledgements

Initial note

Initial admonition

Scope

Text

Terms, Definitions, Symbols and Abbreviated Terms Normal Terms Term2 Definitions
Symbol
Definition
Symbols and abbreviated terms
Symbol
Definition
Clause 4 Introduction Clause 4.2
Annex Annex A.1 Annex A.1a Annex Bibliography Normative References Bibliography Bibliography Subsection
INPUT presxml = <<~"PRESXML" Copyright License Legal Feedback Abstract Foreword

This is a preamble

Introduction Introduction Subsection Dedication Note to reader Acknowledgements
NOTE

Initial note

Initial admonition

1.<tab/>Scope

Text

3.<tab/>Terms, Definitions, Symbols and Abbreviated Terms 3.1.<tab/>Normal Terms 3.1.1. Term2 3.2.<tab/>Definitions
Symbol
Definition
4.<tab/>Symbols and abbreviated terms
Symbol
Definition
5.<tab/>Clause 4 5.1.<tab/>Introduction 5.2.<tab/>Clause 4.2 5.3.
<strong>Annex A</strong><br/>(normative)<br/><br/><strong>Annex</strong> A.1.<tab/>Annex A.1 A.1.1.<tab/>Annex A.1a A.1.2.<tab/>Annex Bibliography <strong>Annex B</strong><br/>(normative) 2.<tab/>Normative References Bibliography Bibliography Subsection
PRESXML html = <<~"OUTPUT" #{HTML_HDR}

License

Feedback


Abstract


Foreword

This is a preamble


Introduction

Introduction Subsection


Dedication


Note to reader


Acknowledgements

NOTE   Initial note

WARNING

Initial admonition

1.  Scope

Text

2.  Normative References

3.  Terms, Definitions, Symbols and Abbreviated Terms

3.1.  Normal Terms

3.1.1.

Term2

3.2.  Definitions

Symbol

Definition

4.  Symbols and abbreviated terms

Symbol

Definition

5.  Clause 4

5.1.  Introduction

5.2.  Clause 4.2

5.3.


Annex A
(normative)

Annex

A.1.  Annex A.1

A.1.1.  Annex A.1a

A.1.2.  Annex Bibliography


Annex B
(normative)


Bibliography

Bibliography Subsection

OUTPUT word = <<~"OUTPUT"