require "spec_helper" RSpec.describe Asciidoctor::Iec do before(:all) do @blank_hdr = blank_hdr_gen end it "processes sections" do expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT") #{ASCIIDOC_BLANK_HDR} .Foreword Text == Introduction === Introduction Subsection == Scope Text == Normative References == Terms and Definitions === Term1 == Terms, Definitions, Symbols and Abbreviated Terms === Normal Terms ==== Term2 === Symbols and Abbreviated Terms == Symbols and Abbreviated Terms == Clause 4 === Introduction === Clause 4.2 == Terms and Definitions [appendix] == Annex === Annex A.1 [%appendix] === Appendix 1 == Bibliography === Bibliography Subsection INPUT #{@blank_hdr} FOREWORD

Text

INTRODUCTION Introduction Subsection
Scope

Text

Terms and definitions

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

#{TERMS_BOILERPLATE} Term1
Terms, definitions, symbols and abbreviated terms Normal Terms Term2 Symbols and abbreviated terms Symbols and abbreviated terms Clause 4 Introduction Clause 4.2 Terms and Definitions
Annex Annex A.1 Appendix 1 Normative references

There are no normative references in this document.

Bibliography Bibliography Subsection
OUTPUT end it "processes sections with title attributes" do expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT") #{ASCIIDOC_BLANK_HDR} .Foreword Text [heading=introduction] == Εισαγωγή === Introduction Subsection [heading=scope] == Σκοπός Text [heading=normative references] == Κανονιστικές Παραπομπές [heading=terms and definitions] == Όροι και Ορισμοί === Term1 [heading="terms, definitions, symbols and abbreviated terms"] == Όροι, Ορισμοί, Σύμβολα και Συντομογραφίες === Normal Terms ==== Term2 [heading=symbols and abbreviated terms] === Σύμβολα και Συντομογραφίες [heading=symbols and abbreviated terms] == Σύμβολα και Συντομογραφίες == Clause 4 === Introduction === Clause 4.2 [appendix] == Annex === Annex A.1 [%appendix] === Appendx 1 [heading=bibliography] == Βιβλιογραφία === Bibliography Subsection INPUT #{@blank_hdr} FOREWORD

Text

INTRODUCTION Introduction Subsection
Scope

Text

Terms and definitions

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

#{TERMS_BOILERPLATE} Term1
Terms, definitions, symbols and abbreviated terms Normal Terms Term2 Symbols and abbreviated terms Symbols and abbreviated terms Clause 4 Introduction Clause 4.2
Annex Annex A.1 Appendx 1 Normative references

There are no normative references in this document.

Bibliography Bibliography Subsection
OUTPUT end it "processes section obligations" do expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT") #{ASCIIDOC_BLANK_HDR} [obligation=informative] == Clause 1 === Clause 1a [obligation=normative] == Clause 2 [appendix,obligation=informative] == Annex INPUT #{@blank_hdr} Clause 1 Clause 1a Clause 2 Annex OUTPUT end it "processes inline headers" do expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT") #{ASCIIDOC_BLANK_HDR} == Clause 1 [%inline-header] === Clause 1a [appendix] == Annex A [%inline-header] === Clause Aa INPUT #{@blank_hdr} Clause 1 Clause 1a Annex A Clause Aa OUTPUT end it "processes blank headers" do expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT") #{ASCIIDOC_BLANK_HDR} == Clause 1 === {blank} INPUT #{@blank_hdr} Clause 1 OUTPUT end end