require "spec_helper" RSpec.describe Metanorma::Requirements::Iso::Modspec do it "treates Modspec requirements as tables for cross-referencing" do input = <<~INPUT Preface /ogc/recommendation/wfs/2
Introduction

INPUT presxml = <<~OUTPUT Preface
Table 1
Table 2 — Permission 1
Identifier /ogc/recommendation/wfs/2
Table 3
Introduction

Table 1 Table 2, Permission 1 Table 3

OUTPUT expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}) .convert("test", input, true) .gsub(%r{^.*.*}m, ""))) .to be_equivalent_to xmlpp(presxml) end it "processes permissions" do input = <<~INPUT Preface /ogc/recommendation/wfs/2 /ss/584/2015/level/1 RFC 2616 (HTTP/1.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 Accomplished
A
B
C
D

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()

TEST PURPOSE

TEST METHOD

CONDITIONS

FIRST PART

SECOND PART

THIRD PART

REFERENCE PART

PANDA PART

Bibliography 2020-03-27 Hypertext Transfer Protocol — HTTP/1.1 https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2616.xml https://www.rfc-editor.org/info/rfc2616 RFC 2616 RFC2616 10.17487/RFC2616 1999-06 R. Fielding IETF IETF J. Gettys IETF IETF J. Mogul IETF IETF H. Frystyk IETF IETF L. Masinter IETF IETF P. Leach IETF IETF T. Berners-Lee IETF IETF en HTTP has been in use by the World-Wide Web global information initiative since 1990. This specification defines the protocol referred to as “HTTP/1.1”, and is an update to RFC 2068. [STANDARDS-TRACK] RFC 2616 Fremont, CA
INPUT presxml = <<~OUTPUT Preface Table 1 — Permission 1
Identifier/ogc/recommendation/wfs/2
Subjectuser
Dependency/ss/584/2015/level/1
DependencyRFC 2616 (HTTP/1.1)
Control-class Technical
Priority P0
Family System and Communications Protection
Family System and Communications Protocols
Statement

I recommend this .

Statement
A
B
C
D

The measurement target shall be measured as:

1 r/1 = 0

The following code will be run for verification:

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

TEST PURPOSE

Test method

TEST METHOD

Conditions

CONDITIONS

A

FIRST PART

B

SECOND PART

C

THIRD PART

Reference

REFERENCE PART

Panda GHz express

PANDA PART

Bibliography Hypertext Transfer Protocol — HTTP/1.1 https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2616.xml https://www.rfc-editor.org/info/rfc2616 [1] IETF RFC 2616 IETF RFC2616 DOI 10.17487/RFC2616
OUTPUT expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}) .convert("test", input, true) .gsub(%r{^.*.*}m, ""))) .to be_equivalent_to xmlpp(presxml) end it "processes permission verifications" do input = <<~INPUT Preface /ogc/recommendation/wfs/2 /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 Accomplished
A
B
C
D

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 presxml = <<~OUTPUT Preface Table 1 — Permission test 1
Identifier /ogc/recommendation/wfs/2
Subject user
Dependency /ss/584/2015/level/1
Control-class Technical
Priority P0
Family System and Communications Protection
Family System and Communications Protocols
Statement

I recommend this .

Statement
A
B
C
D

The measurement target shall be measured as:

1 r/1 = 0

The following code will be run for verification:

CoreRoot(success): HttpResponse if (success) recommendation(label: success-response) end#{' '}
OUTPUT expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}) .convert("test", input, true) .gsub(%r{^.*.*}m, ""))) .to be_equivalent_to xmlpp(presxml) end it "processes abstract tests" do input = <<~INPUT Preface /ogc/recommendation/wfs/2 /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 Accomplished
A
B
C
D

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 presxml = <<~OUTPUT Preface Table 1 — Abstract test 1
Identifier/ogc/recommendation/wfs/2
Subjectuser
Dependency/ss/584/2015/level/1
Control-classTechnical
PriorityP0
FamilySystem and Communications Protection
FamilySystem and Communications Protocols
Statement

I recommend this.

Statement
A
B
C
D

The measurement target shall be measured as:

1 r/1 = 0

The following code will be run for verification:

CoreRoot(success): HttpResponse if (success) recommendation(label: success-response) end
OUTPUT expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}) .convert("test", input, true) .gsub(%r{^.*.*}m, ""))) .to be_equivalent_to xmlpp(presxml) end it "processes permission classes" do input = <<~INPUT Preface /ogc/recommendation/wfs/2 /ss/584/2015/level/1 /ss/584/2015/level/2 user /ogc/recommendation/wfs/10 Requirement 1 Recommendation 1 /ogc/recommendation/wfs/10 INPUT presxml = <<~OUTPUT Preface Table 1 — Permissions class 1
Identifier /ogc/recommendation/wfs/2
Target type user
Dependency /ss/584/2015/level/1
Dependency /ss/584/2015/level/2
Provisions Permission 1: /ogc/recommendation/wfs/10
Requirement 1-1: Requirement 1
Recommendation 1-1: Recommendation 1
Table 2 — Permission 1
Identifier /ogc/recommendation/wfs/10
Included in Permissions class 1: /ogc/recommendation/wfs/2
OUTPUT expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}) .convert("test", input, true) .gsub(%r{^.*.*}m, ""))) .to be_equivalent_to xmlpp(presxml) end it "processes conformance classes" do input = <<~INPUT Preface /ogc/recommendation/wfs/2 /ss/584/2015/level/1 ABC user targetABC indirect-dependency indirect-dependencyABC Permission 1 Requirement 1 Recommendation 1 ABC Permission 1 INPUT presxml = <<~OUTPUT Preface Table 1 — Conformance class 1
Identifier /ogc/recommendation/wfs/2
Subject user
Requirements class Conformance class 2: ABC
Dependency /ss/584/2015/level/1
Dependency Conformance class 2: ABC
Indirect Dependency
Indirect Dependency Conformance class 2: ABC
Provisions Permission 1: Permission 1
Requirement 1-1: Requirement 1
Recommendation 1-1: Recommendation 1
Table 2 — Conformance class 2
Identifier ABC
Table 3 — Permission 1
Identifier Permission 1
Included in Conformance class 1: /ogc/recommendation/wfs/2
OUTPUT expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}) .convert("test", input, true) .gsub(%r{^.*.*}m, ""))) .to be_equivalent_to xmlpp(presxml) end it "processes conformance classes in French" do input = <<~INPUT fr Preface /ogc/recommendation/wfs/2 /ss/584/2015/level/1 ABC user targetABC indirect-dependency indirect-dependencyABC Permission 1 Requirement 1 Recommendation 1 ABC Permission 1 INPUT presxml = <<~OUTPUT fr Preface Tableau 1 — Classe de confirmité 1
Identifiant /ogc/recommendation/wfs/2
Sujet user
Classe d’exigences Classe de confirmité 2: ABC
Dépendance /ss/584/2015/level/1
Dépendance Classe de confirmité 2: ABC
Dépendance indirecte
Dépendance indirecte Classe de confirmité 2: ABC
Dispositions Autorisation 1: Permission 1
Exigence 1-1: Requirement 1
Recommandation 1-1: Recommendation 1
Tableau 2 — Classe de confirmité 2
Identifiant ABC
Tableau 3 — Autorisation 1
Identifiant Permission 1
Inclus dans Classe de confirmité 1: /ogc/recommendation/wfs/2
OUTPUT expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}) .convert("test", input, true) .gsub(%r{.*}m, "") .gsub(%r{^.*.*}m, ""))) .to be_equivalent_to xmlpp(presxml) end it "processes requirement classes" do input = <<~INPUT Preface /ogc/recommendation/wfs/2 /ss/584/2015/level/1 /ss/584/2015/level/2 user Permission 1 Requirement 1 Recommendation 1 Permission 1 INPUT presxml = <<~OUTPUT Preface Table 1 — Requirements class 1
Identifier /ogc/recommendation/wfs/2
Target type user
Dependency /ss/584/2015/level/1
Dependency /ss/584/2015/level/2
Provisions Permission 1: Permission 1
Requirement 1-1: Requirement 1
Recommendation 1-1: Recommendation 1
Table 2 — Permission 1
Identifier Permission 1
Included in Requirements class 1: /ogc/recommendation/wfs/2
OUTPUT expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}) .convert("test", input, true) .gsub(%r{^.*.*}m, ""))) .to be_equivalent_to xmlpp(presxml) end it "processes recommendation classes" do input = <<~INPUT Preface /ogc/recommendation/wfs/2 /ss/584/2015/level/1 /ss/584/2015/level/2 user Permission 1 Requirement 1 Recommendation 1 INPUT presxml = <<~OUTPUT Preface Table 1 — Recommendations class 1
Identifier /ogc/recommendation/wfs/2
Target type user
Dependency /ss/584/2015/level/1
Dependency /ss/584/2015/level/2
Provisions Permission 1-1: Permission 1
Requirement 1-1: Requirement 1
Recommendation 1-1: Recommendation 1
OUTPUT expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}) .convert("test", input, true) .gsub(%r{^.*.*}m, ""))) .to be_equivalent_to xmlpp(presxml) end it "processes requirements" do input = <<~INPUT Preface A New Requirement /ogc/recommendation/wfs/2 /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 presxml = <<~OUTPUT Preface Table — Requirement: A New Requirement
Identifier /ogc/recommendation/wfs/2
Subject user
Dependency /ss/584/2015/level/1
Statement

I recommend this .

Statement

As for the measurement targets,

The measurement target shall be measured as:

1 r/1 = 0

The following code will be run for verification:

CoreRoot(success): HttpResponse if (success) recommendation(label: success-response) end
OUTPUT expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}) .convert("test", input, true) .gsub(%r{^.*.*}m, ""))) .to be_equivalent_to xmlpp(presxml) end it "processes recommendations" do input = <<~INPUT Preface /ogc/recommendation/wfs/2 /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 presxml = <<~OUTPUT Preface Table 1 — Recommendation 1
Identifier /ogc/recommendation/wfs/2
Subject user
Dependency /ss/584/2015/level/1
Statement

I recommend this .

Statement

As for the measurement targets,

The measurement target shall be measured as:

1 r/1 = 0

The following code will be run for verification:

CoreRoot(success): HttpResponse if (success) recommendation(label: success-response) end
OUTPUT expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}) .convert("test", input, true) .gsub(%r{^.*.*}m, ""))) .to be_equivalent_to xmlpp(presxml) end end