require "spec_helper" RSpec.describe Asciidoctor::ISO do it "processes sections" do expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT") #{ASCIIDOC_BLANK_HDR} == Foreword Text == Introduction === Introduction Subsection == Scope Text == Acknowledgements == 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 Acknowledgements
Scope

Text

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:

Term1
Terms, definitions, symbols and abbreviated terms

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:

  • ISO Online browsing platform: available at

  • IEC Electropedia: available at

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 section obligations" do expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, 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: :iso, 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: :iso, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT") #{ASCIIDOC_BLANK_HDR} == Clause 1 === {blank} INPUT #{BLANK_HDR} Clause 1 OUTPUT end it "processes terms & definitions with external source" do expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT") #{ASCIIDOC_BLANK_HDR} Foreword [source="iso1234,iso5678"] == Terms and Definitions === Term1 INPUT #{BLANK_HDR.sub(//, '')} Foreword

Foreword

Terms and definitions

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

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

  • ISO Online browsing platform: available at

  • IEC Electropedia: available at

Term1
OUTPUT end it "processes empty terms & definitions" do expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT") #{ASCIIDOC_BLANK_HDR} Foreword == Terms and Definitions INPUT #{BLANK_HDR} Foreword

Foreword

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:

  • ISO Online browsing platform: available at

  • IEC Electropedia: available at

OUTPUT end it "processes empty terms & definitions with external source" do expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT") #{ASCIIDOC_BLANK_HDR} Foreword [source="iso1234,iso5678"] == Terms and Definitions INPUT #{BLANK_HDR.sub(//, '')} Foreword

Foreword

Terms and definitions

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

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

  • ISO Online browsing platform: available at

  • IEC Electropedia: available at

OUTPUT end end