require "spec_helper" RSpec.describe Asciidoctor::ISO do it "processes basic tables" do expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT") #{ASCIIDOC_BLANK_HDR} .Table Name |=== |A |B |C h|1 |2 |3 |=== INPUT #{BLANK_HDR} Table Name
A B C
1 2 3
OUTPUT end it "inserts header rows in a table with a name and no header" do expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT") #{ASCIIDOC_BLANK_HDR} [headerrows=2] .Table Name |=== |A |B |C h|1 |2 |3 h|1 |2 |3 |=== INPUT #{BLANK_HDR} Table Name
A B C
1 2 3
1 2 3
OUTPUT end it "inserts header rows in a table without a name and no header" do expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT") #{ASCIIDOC_BLANK_HDR} [headerrows=2] |=== |A |B |C h|1 |2 |3 h|1 |2 |3 |=== INPUT #{BLANK_HDR}
A B C
1 2 3
1 2 3
OUTPUT end it "processes complex tables" do expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT") #{ASCIIDOC_BLANK_HDR} [cols="<,^,^,^,^",options="header,footer",headerrows=2] .Maximum permissible mass fraction of defects |=== .2+|Defect 4+^| Maximum permissible mass fraction of defects in husked rice + stem:[w_max] | in husked rice | in milled rice (non-glutinous) | in husked parboiled rice | in milled parboiled rice | Extraneous matter: organic footnote:[Organic extraneous matter includes foreign seeds, husks, bran, parts of straw, etc.] | 1,0 | 0,5 | 1,0 | 0,5 // not rendered list here | Extraneous matter: inorganic footnote:[Inorganic extraneous matter includes stones, sand, dust, etc.] | 0,5 | 0,5 | 0,5 | 0,5 | Paddy | 2,5 | 0,3 | 2,5 | 0,3 | Husked rice, non-parboiled | Not applicable | 1,0 | 1,0 | 1,0 | Milled rice, non-parboiled | 1,0 | Not applicable | 1,0 | 1,0 | Husked rice, parboiled | 1,0 | 1,0 | Not applicable | 1,0 | Milled rice, parboiled | 1,0 | 1,0 | 1,0 | Not applicable | Chips | 0,1 | 0,1 | 0,1 | 0,1 | HDK | 2,0 footnote:defectsmass[The maximum permissible mass fraction of defects shall be determined with respect to the mass fraction obtained after milling.] | 2,0 | 2,0 footnote:defectsmass[] | 2,0 | Damaged kernels | 4,0 | 3,0 | 4,0 | 3,0 | Immature and/or malformed kernels | 8,0 | 2,0 | 8,0 | 2,0 | Chalky kernels | 5,0 footnote:defectsmass[] | 5,0 | Not applicable | Not applicable | Red kernels and red-streaked kernels | 12,0 | 12,0 | 12,0 footnote:defectsmass[] | 12,0 | Partly gelatinized kernels | Not applicable | Not applicable | 11,0 footnote:defectsmass[] | 11,0 | Pecks | Not applicable | Not applicable | 4,0 | 2,0 | Waxy rice | 1,0 footnote:defectsmass[] | 1,0 | 1,0 footnote:defectsmass[] | 1,0 5+a| Live insects shall not be present. Dead insects shall be included in extraneous matter. |=== INPUT #{BLANK_HDR} Maximum permissible mass fraction of defects
Defect Maximum permissible mass fraction of defects in husked rice
w max
in husked rice in milled rice (non-glutinous) in husked parboiled rice in milled parboiled rice
Extraneous matter: organic

Organic extraneous matter includes foreign seeds, husks, bran, parts of straw, etc.

1,0 0,5 1,0 0,5
Extraneous matter: inorganic

Inorganic extraneous matter includes stones, sand, dust, etc.

0,5 0,5 0,5 0,5
Paddy 2,5 0,3 2,5 0,3
Husked rice, non-parboiled Not applicable 1,0 1,0 1,0
Milled rice, non-parboiled 1,0 Not applicable 1,0 1,0
Husked rice, parboiled 1,0 1,0 Not applicable 1,0
Milled rice, parboiled 1,0 1,0 1,0 Not applicable
Chips 0,1 0,1 0,1 0,1
HDK 2,0

The maximum permissible mass fraction of defects shall be determined with respect to the mass fraction obtained after milling.

2,0 2,0

The maximum permissible mass fraction of defects shall be determined with respect to the mass fraction obtained after milling.

2,0
Damaged kernels 4,0 3,0 4,0 3,0
Immature and/or malformed kernels 8,0 2,0 8,0 2,0
Chalky kernels 5,0

The maximum permissible mass fraction of defects shall be determined with respect to the mass fraction obtained after milling.

5,0 Not applicable Not applicable
Red kernels and red-streaked kernels 12,0 12,0 12,0

The maximum permissible mass fraction of defects shall be determined with respect to the mass fraction obtained after milling.

12,0
Partly gelatinized kernels Not applicable Not applicable 11,0

The maximum permissible mass fraction of defects shall be determined with respect to the mass fraction obtained after milling.

11,0
Pecks Not applicable Not applicable 4,0 2,0
Waxy rice 1,0

The maximum permissible mass fraction of defects shall be determined with respect to the mass fraction obtained after milling.

1,0 1,0

The maximum permissible mass fraction of defects shall be determined with respect to the mass fraction obtained after milling.

1,0

Live insects shall not be present. Dead insects shall be included in extraneous matter.

OUTPUT end end