require "spec_helper" RSpec.describe IsoDoc do it "processes introductions under IEV" do expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT") IEC/PWI 60050-871 ED 2 60050 Foreword

This is a preamble

Introduction Introduction Subsection
INPUT #{HTML_HDR}

FOREWORD


INTRODUCTION
Principles and rules followed

Introduction Subsection

#{IEC_TITLE1}
OUTPUT end it "processes bibliographies under IEV" do expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT") IEC 60050 ED 1 60050 International Electrotechnical Commission IEC International Electrotechnical Commission IEC en 60 60 2020 International Electrotechnical Commission IEC article IEC 60050 Normative References

There are no normative references in this document.

TITLE B
Bibliography

There are no normative references in this document.

TITLE B
INPUT #{HTML_HDR}

FOREWORD

#{IEC_TITLE1}

1  Normative references

There are no normative references in this document.

B, TITLE

OUTPUT end it "processes IEV terms" do expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT") IEC 60050-192 ED 1 60050 Terms and definitions General paddy

rice retaining its husk after threshing

Foreign seeds, husks, bran, sand, dust.

  • A
  • A
3.1

The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here

paddypaddy rice rough rice cargo rice rice

rice retaining its husk after threshing

  • A

The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.

  • A

The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.

3.1
INPUT #{HTML_HDR}

FOREWORD

#{IEC_TITLE1}

1  Terms and definitions


192-01 General

192-01-01

paddy

rice retaining its husk after threshing

EXAMPLE 1   Foreign seeds, husks, bran, sand, dust.

  • A

EXAMPLE 2  

  • A

[TERMREF] ISO 7301:2011, 3.1 [MODIFICATION]The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here [/TERMREF]

192-01-02

paddy, <rice>

paddy rice, <rice>

rough rice, <rice>

DEPRECATED: cargo rice, <rice>

rice retaining its husk after threshing

EXAMPLE  

  • A

Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.

Note 2 to entry:

  • A

The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.

[TERMREF] ISO 7301:2011, 3.1 [/TERMREF]

OUTPUT end it "populates Word template with terms reference labels" do FileUtils.rm_f "test.doc" FileUtils.rm_f "test.html" IsoDoc::Iec::WordConvert.new({}).convert("test", <<~"INPUT", false) IEC 60050-192 ED 1 60050 Terms and definitions General paddy

rice retaining its husk after threshing

3.1

The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here

INPUT word = File.read("test.doc").sub(/^.*
/m, '
'). sub(%r{
.*$}m, "") expect(xmlpp(word)).to be_equivalent_to xmlpp(<<~"OUTPUT")

 

1   Terms and definitions


192-01 General

192-01-01

paddy

rice retaining its husk after threshing

SOURCE: ISO 7301:2011, 3.1 , modified — The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here

OUTPUT end end