require "spec_helper" RSpec.describe IsoDoc do it "processes unlabelled notes" do expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"

These results are based on a study carried out on three different types of kernel.

INPUT #{HTML_HDR}

Foreword

NOTE  These results are based on a study carried out on three different types of kernel.

OUTPUT end it "processes unlabelled notes (Word)" do expect(IsoDoc::WordConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"

These results are based on a study carried out on three different types of kernel.

INPUT

 



Foreword

NOTE  These results are based on a study carried out on three different types of kernel.

 


OUTPUT end it "processes labelled notes" do expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"

These results are based on a study carried out on three different types of kernel.

INPUT #{HTML_HDR}

Foreword

NOTE  These results are based on a study carried out on three different types of kernel.

OUTPUT end it "processes sequences of notes" do expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"

These results are based on a study carried out on three different types of kernel.

These results are based on a study carried out on three different types of kernel.

INPUT #{HTML_HDR}

Foreword

NOTE 1  These results are based on a study carried out on three different types of kernel.

NOTE 2  These results are based on a study carried out on three different types of kernel.

OUTPUT end it "processes multi-para notes" do expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"

These results are based on a study carried out on three different types of kernel.

These results are based on a study carried out on three different types of kernel.

INPUT #{HTML_HDR}

Foreword

NOTE  These results are based on a study carried out on three different types of kernel.

These results are based on a study carried out on three different types of kernel.

OUTPUT end it "processes non-para notes" do expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"

A

B

INPUT #{HTML_HDR}

Foreword

NOTE 

A

B

OUTPUT end it "processes non-para notes (Word)" do expect(IsoDoc::WordConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"

A

B

INPUT

 



Foreword

NOTE 

A

B

  • C

 


OUTPUT end it "processes figures" do expect(strip_guid(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to <<~"OUTPUT"
Split-it-right sample divider alttext

The time t_90 was estimated to be 18,2 min for this example.

A

B

A <
B
A <
B
INPUT #{HTML_HDR}

Foreword

alttext a

Key

A

B

Figure 1 — Split-it-right sample divider

A <
B

Figure 2

A <
B

OUTPUT end it "processes figures (Word)" do expect(strip_guid(IsoDoc::WordConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to <<~"OUTPUT"

Split-it-right sample divider

The time t_90 was estimated to be 18,2 min for this example.

A

B

A <
B
INPUT

 



Foreword

a

Key

A

B

Figure 1 — Split-it-right sample divider

A <
B

Figure 2

 


OUTPUT end it "processes examples" do expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"

Hello

INPUT #{HTML_HDR}

Foreword

EXAMPLE

Hello

OUTPUT end it "processes sequences of examples" do expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"

Hello

Hello

Hello

INPUT #{HTML_HDR}

Foreword

EXAMPLE 1

Hello

EXAMPLE 2

Hello

EXAMPLE

Hello

OUTPUT end it "processes sourcecode" do expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT" Ruby code puts x INPUT #{HTML_HDR}

Foreword


   
  puts x

Ruby code

OUTPUT end it "processes sourcecode (Word)" do expect(IsoDoc::WordConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT" Ruby code puts x INPUT

 



Foreword


   
  puts x

Ruby code

 


OUTPUT end it "processes sourcecode with escapes preserved" do expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT" XML code <xml> INPUT #{HTML_HDR}

Foreword


   
  <xml>

XML code

OUTPUT end it "processes sourcecode with annotations" do expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT" puts "Hello, world." 1 %w{a b c}.each do |x| puts x 2 end

This is one callout

This is another callout

INPUT #{HTML_HDR}

Foreword

puts "Hello, world."  <1>
   %w{a b c}.each do |x|
     puts x <2>
   end<1>

This is one callout

<2>

This is another callout

OUTPUT end it "processes admonitions" do expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"

Only use paddy or parboiled rice for the determination of husked rice yield.

INPUT #{HTML_HDR}

Foreword

CAUTION

Only use paddy or parboiled rice for the determination of husked rice yield.

OUTPUT end it "processes admonitions with titles" do expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT" Title

Only use paddy or parboiled rice for the determination of husked rice yield.

INPUT #{HTML_HDR}

Foreword

Title

Only use paddy or parboiled rice for the determination of husked rice yield.

OUTPUT end it "processes formulae" do expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT" r = 1 %

r

is the repeatability limit.

[durationUnits] is essentially a duration statement without the "P" prefix. "P" is unnecessary because between "G" and "U" duration is always expressed.

r = 1 % INPUT #{HTML_HDR}

Foreword

(#(r = 1 %)#)

where

(#(r)#)

is the repeatability limit.

NOTE  [durationUnits] is essentially a duration statement without the "P" prefix. "P" is unnecessary because between "G" and "U" duration is always expressed.

(#(r = 1 %)#)  (1)

OUTPUT end it "processes paragraph alignments" do expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"

Vache Equipment
Fictitious
World

Justify

INPUT #{HTML_HDR}

Foreword

Vache Equipment
Fictitious
World

Justify

OUTPUT end it "processes paragraph alignments (Word)" do expect(IsoDoc::WordConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"

Vache Equipment
Fictitious
World

Justify

INPUT

 



Foreword

Vache Equipment
Fictitious
World

Justify

 


OUTPUT end it "processes blockquotes" do expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT" 1 ISO

This International Standard gives the minimum specifications for rice (Oryza sativa L.) which is subject to international trade. It is applicable to the following types: husked rice and milled rice, parboiled or not, intended for direct human consumption. It is neither applicable to other products derived from rice, nor to waxy rice (glutinous rice).

INPUT #{HTML_HDR}

Foreword

This International Standard gives the minimum specifications for rice (Oryza sativa L.) which is subject to international trade. It is applicable to the following types: husked rice and milled rice, parboiled or not, intended for direct human consumption. It is neither applicable to other products derived from rice, nor to waxy rice (glutinous rice).

— ISO, ISO 7301:2011, Clause 1

OUTPUT end it "processes term domains" do expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT" extraneous matterEM rice

organic and inorganic components other than whole or broken kernels

INPUT #{HTML_HDR}

1.  Terms and definitions

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

1.1.

extraneous matter

EM

<rice> organic and inorganic components other than whole or broken kernels

OUTPUT end it "processes permissions" do expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT" /ss/584/2015/level/1 user control-class Technical priority P0 family System and Communications Protection family System and Communications Protocols

I recommend this.

This is the object of the recommendation:

Object Value
Mission Accomplished

As for the measurement targets,

The measurement target shall be measured as:

r/1 = 0

The following code will be run for verification:

CoreRoot(success): HttpResponse if (success) recommendation(label: success-response) end
success-response()
INPUT #{HTML_HDR}

Foreword

Permission 1:
/ogc/recommendation/wfs/2

/ss/584/2015/level/1

I recommend this.

As for the measurement targets,

The measurement target shall be measured as:

(#(r/1 = 0)#)  (1)

The following code will be run for verification:

CoreRoot(success): HttpResponse
      if (success)
      recommendation(label: success-response)
      end
   

OUTPUT end it "processes requirements" do expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT" A New Requirement /ss/584/2015/level/1 user

I recommend this.

This is the object of the recommendation:

Object Value
Mission Accomplished

As for the measurement targets,

The measurement target shall be measured as:

r/1 = 0

The following code will be run for verification:

CoreRoot(success): HttpResponse if (success) recommendation(label: success-response) end
success-response() INPUT #{HTML_HDR}

Foreword


/ogc/recommendation/wfs/2. A New Requirement

/ss/584/2015/level/1

I recommend this.

As for the measurement targets,

The measurement target shall be measured as:

(#(r/1 = 0)#)  (1)

The following code will be run for verification:

CoreRoot(success): HttpResponse
      if (success)
      recommendation(label: success-response)
      end
   

OUTPUT end it "processes recommendation" do expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT" /ss/584/2015/level/1 user

I recommend this.

This is the object of the recommendation:

Object Value
Mission Accomplished

As for the measurement targets,

The measurement target shall be measured as:

r/1 = 0

The following code will be run for verification:

CoreRoot(success): HttpResponse if (success) recommendation(label: success-response) end
success-response() INPUT #{HTML_HDR}

Foreword

Recommendation 1:
/ogc/recommendation/wfs/2

/ss/584/2015/level/1

I recommend this.

As for the measurement targets,

The measurement target shall be measured as:

(#(r/1 = 0)#)  (1)

The following code will be run for verification:

CoreRoot(success): HttpResponse
      if (success)
      recommendation(label: success-response)
      end
   

OUTPUT end end