modspec 0.1.4 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +4 -0
  3. data/.github/workflows/release.yml +5 -0
  4. data/.rubocop.yml +18 -6
  5. data/.rubocop_todo.yml +108 -76
  6. data/CLAUDE.md +61 -0
  7. data/Gemfile +4 -3
  8. data/lib/modspec/conformance_class.rb +4 -8
  9. data/lib/modspec/conformance_test.rb +19 -5
  10. data/lib/modspec/identifier.rb +0 -1
  11. data/lib/modspec/normative_statement.rb +3 -39
  12. data/lib/modspec/normative_statements_class.rb +3 -3
  13. data/lib/modspec/suite.rb +73 -82
  14. data/lib/modspec/version.rb +1 -1
  15. data/lib/modspec.rb +8 -22
  16. data/modspec.gemspec +3 -2
  17. data/spec/conformance_class.liquid +2 -2
  18. data/spec/fixtures/advanced-json-rc.yaml +5 -7
  19. data/spec/fixtures/advanced-rc.yaml +12 -14
  20. data/spec/fixtures/basic-quaternion-json-rc.yaml +5 -7
  21. data/spec/fixtures/basic-quaternion-json-strict-rc.yaml +4 -5
  22. data/spec/fixtures/basic-quaternion-rc.yaml +7 -8
  23. data/spec/fixtures/basic-ypr-json-rc.yaml +5 -8
  24. data/spec/fixtures/basic-ypr-rc.yaml +7 -7
  25. data/spec/fixtures/chain-json-rc.yaml +5 -7
  26. data/spec/fixtures/chain-rc.yaml +11 -13
  27. data/spec/fixtures/frame-spec-rc.yaml +10 -10
  28. data/spec/fixtures/global-rc.yaml +7 -4
  29. data/spec/fixtures/graph-json-rc.yaml +5 -7
  30. data/spec/fixtures/graph-rc.yaml +11 -13
  31. data/spec/fixtures/series-irregular-json-rc.yaml +5 -7
  32. data/spec/fixtures/series-irregular-rc.yaml +13 -15
  33. data/spec/fixtures/series-regular-json-rc.yaml +5 -7
  34. data/spec/fixtures/series-regular-rc.yaml +15 -17
  35. data/spec/fixtures/stream-json-rc.yaml +9 -11
  36. data/spec/fixtures/stream-rc.yaml +10 -12
  37. data/spec/fixtures/tangent-point-rc.yaml +10 -11
  38. data/spec/fixtures/time-rc.yaml +6 -8
  39. data/spec/modspec/conformance_class_spec.rb +44 -35
  40. data/spec/modspec/conformance_test_spec.rb +26 -7
  41. data/spec/modspec/normative_statement_spec.rb +16 -12
  42. data/spec/modspec/normative_statements_class_spec.rb +18 -6
  43. data/spec/modspec/suite_spec.rb +198 -37
  44. data/spec/modspec_spec.rb +7 -7
  45. data/spec/spec_helper.rb +1 -0
  46. metadata +6 -4
@@ -1,27 +1,27 @@
1
1
  ---
2
2
  normative_statements_classes:
3
3
  - name: Frame specification requirements
4
- identifier: /req/frame-spec
5
- description: |
6
- Common frame specification requirements for SDUs that include frames.
4
+ identifier: "/req/frame-spec"
5
+ description: 'Common frame specification requirements for SDUs that include frames.'
7
6
  normative_statements:
8
-
9
- - name: Frame specification authority uniquely specifies source of reference frame specification
10
- identifier: /req/frame-spec/authority
7
+ - name: Frame specification authority uniquely specifies source of reference frame
8
+ specification
9
+ identifier: "/req/frame-spec/authority"
11
10
  statement: |
12
11
  The FrameSpecification.authority attribute SHALL contain a string uniquely
13
12
  specifying a source of reference frame specifications.
14
-
13
+ obligation: requirement
15
14
  - name: Frame specification ID uniquely defines frame within authority
16
- identifier: /req/frame-spec/id
15
+ identifier: "/req/frame-spec/id"
17
16
  statement: |
18
17
  The FrameSpecification.ID attribute SHALL be a string uniquely defining a
19
18
  frame within the authority.
20
-
19
+ obligation: requirement
21
20
  - name: Frame specification parameter contains all parameters needed
22
- identifier: /req/frame-spec/parameters
21
+ identifier: "/req/frame-spec/parameters"
23
22
  statement: |
24
23
  The FrameSpecification.parameter attribute SHALL contain all parameters
25
24
  needed for the corresponding authority and ID.
26
25
  guidance:
27
26
  - The definition of these parameters is outside the scope of GeoPose.
27
+ obligation: requirement
@@ -1,23 +1,26 @@
1
1
  ---
2
2
  normative_statements_classes:
3
3
  - name: Global SDU requirements
4
- identifier: /req/global
4
+ identifier: "/req/global"
5
5
  description: Global requirements apply to all SDUs and Standardization Targets.
6
6
  normative_statements:
7
7
  - name: Individual standardization targets are independent
8
- identifier: /req/global/target-independence
8
+ identifier: "/req/global/target-independence"
9
9
  statement: |
10
10
  There shall be no dependency between or among the individual
11
11
  Standardization Targets.
12
+ obligation: requirement
12
13
  - name: Implementation conforms to the logical model
13
- identifier: /req/global/logical-model
14
+ identifier: "/req/global/logical-model"
14
15
  statement: |
15
16
  Implementations of concrete data conforming to this standard SHALL
16
17
  conform to all dependent or inherited classes, attributes, and
17
18
  associations, multiplicities, and data types in the Logical Model.
19
+ obligation: requirement
18
20
  - name: SDU conforms to the "Structural Data Unit - SDU" stereotype
19
- identifier: /req/global/sdu
21
+ identifier: "/req/global/sdu"
20
22
  statement: |
21
23
  Implementations using encoded SDUs SHALL conform to the logical
22
24
  description of the Logical Model elements with the
23
25
  "Structural Data Unit - SDU" stereotype.
26
+ obligation: requirement
@@ -1,16 +1,13 @@
1
1
  ---
2
2
  normative_statements_classes:
3
3
  - name: JSON encoding of Graph SDU
4
- identifier: /req/graph-encoding-json
5
- description: |
6
- Requirements for the JSON encoding of a Graph SDU.
4
+ identifier: "/req/graph-encoding-json"
5
+ description: 'Requirements for the JSON encoding of a Graph SDU.'
7
6
  implements:
8
- - /req/graph
9
-
7
+ - "/req/graph"
10
8
  normative_statements:
11
-
12
9
  - name: Specification as JSON schema
13
- identifier: /req/graph-encoding-json/definition
10
+ identifier: "/req/graph-encoding-json/definition"
14
11
  statement: |
15
12
  A JSON-encoded GeoPose Graph SHALL conform to the GeoPose Chain
16
13
  JSON-Schema 2019-9 definition (<<graph_json_schema>>).
@@ -18,3 +15,4 @@ normative_statements_classes:
18
15
  - |
19
16
  This JSON encoding is extensible because the JSON-Schema
20
17
  "additionalProperties" property is set to the default value of *true*.
18
+ obligation: requirement
@@ -1,38 +1,36 @@
1
1
  ---
2
2
  normative_statements_classes:
3
3
  - name: Graph logical model SDU
4
- identifier: /req/graph
4
+ identifier: "/req/graph"
5
5
  description: |
6
6
  The Graph Target supports a network of object relative poses. The graph is a
7
7
  directed acyclic graph, each node must either be an Extrinsic Frame or
8
8
  reachable from an Extrinsic Frame.
9
-
10
9
  dependencies:
11
- - /req/global
12
- - /req/frame-spec
13
- - /req/time
14
-
10
+ - "/req/global"
11
+ - "/req/frame-spec"
12
+ - "/req/time"
15
13
  normative_statements:
16
-
17
14
  - name: Expression of valid time as GeoPose_Instant
18
- identifier: /req/graph/valid-time
15
+ identifier: "/req/graph/valid-time"
19
16
  dependencies:
20
- - /req/time/instant
17
+ - "/req/time/instant"
21
18
  statement: |
22
19
  The `Graph.validTime` attribute shall be represented by a
23
20
  `GeoPose_Instant` object.
24
-
21
+ obligation: requirement
25
22
  - name: List of frame specifications
26
- identifier: /req/graph/frame-list
23
+ identifier: "/req/graph/frame-list"
27
24
  statement: |
28
25
  The `Graph.frameList` attribute shall represent a list of explicit
29
26
  frame specifications with an array of `ExplicitFrameSpec` objects.
30
-
27
+ obligation: requirement
31
28
  - name: Transforms for frame specification list
32
- identifier: /req/graph/transform-list
29
+ identifier: "/req/graph/transform-list"
33
30
  statement: |
34
31
  The `Graph.transformList` attribute shall have a value of type
35
32
  `FrameTransformIndexPair`.
36
33
  Each index value in a `FrameListTransformPair` SHALL be a distinct integer
37
34
  value between 0 and one less than the number of elements in the
38
35
  `frameList` property.
36
+ obligation: requirement
@@ -1,16 +1,13 @@
1
1
  ---
2
2
  normative_statements_classes:
3
3
  - name: JSON encoding of Irregular Series SDU
4
- identifier: /req/series-irregular-encoding-json
5
- description: |
6
- Requirements for the JSON encoding of a Irregular Series SDU.
4
+ identifier: "/req/series-irregular-encoding-json"
5
+ description: 'Requirements for the JSON encoding of a Irregular Series SDU.'
7
6
  implements:
8
- - /req/series-irregular
9
-
7
+ - "/req/series-irregular"
10
8
  normative_statements:
11
-
12
9
  - name: Specification as JSON schema
13
- identifier: /req/series-irregular-encoding-json/definition
10
+ identifier: "/req/series-irregular-encoding-json/definition"
14
11
  statement: |
15
12
  A JSON-encoded GeoPose Irregular Series SHALL conform to the GeoPose Chain
16
13
  JSON-Schema 2019-9 definition (<<irregular_series_json_schema>>).
@@ -18,3 +15,4 @@ normative_statements_classes:
18
15
  - |
19
16
  This JSON encoding is extensible because the JSON-Schema
20
17
  "additionalProperties" property is set to the default value of *true*.
18
+ obligation: requirement
@@ -1,41 +1,39 @@
1
1
  ---
2
2
  normative_statements_classes:
3
3
  - name: Irregular_Series logical model SDU
4
- identifier: /req/series-irregular
4
+ identifier: "/req/series-irregular"
5
5
  description: |
6
6
  The Irregular_Series Target represents the time evolution of a single
7
7
  GeoPose, with a variable time duration between successive inner frames.
8
-
9
8
  dependencies:
10
- - /req/global
11
- - /req/frame-spec
12
- - /req/time
13
-
9
+ - "/req/global"
10
+ - "/req/frame-spec"
11
+ - "/req/time"
14
12
  normative_statements:
15
-
16
13
  - name: Expression of inner frames and time series
17
- identifier: /req/series-irregular/inner-frame-and-time
14
+ identifier: "/req/series-irregular/inner-frame-and-time"
18
15
  dependencies:
19
- - /req/time/instant
16
+ - "/req/time/instant"
20
17
  statement: |
21
18
  The `Irregular_Series.innerFrameAndTime` attribute SHALL be implemented as
22
19
  an array of `FrameAndTimeElement` objects, each of which is a pair of
23
20
  `ExplicitFrameSpec` and `GeoPoseInstant` objects.
24
-
21
+ obligation: requirement
25
22
  - name: Expression of outer frame
26
- identifier: /req/series-irregular/outer-frame
23
+ identifier: "/req/series-irregular/outer-frame"
27
24
  statement: |
28
25
  The `Irregular_Series.outerFrame` attribute shall represent the first
29
26
  frame in the series expressed by the `innerFrameAndTime` attribute.
30
-
27
+ obligation: requirement
31
28
  - name: Expression of series header
32
- identifier: /req/series-irregular/header
29
+ identifier: "/req/series-irregular/header"
33
30
  statement: |
34
31
  The `Irregular_Series.header` attribute shall be implemented as an instance
35
32
  of SeriesHeader.
36
-
33
+ obligation: requirement
37
34
  - name: Expression of series trailer
38
- identifier: /req/series-irregular/trailer
35
+ identifier: "/req/series-irregular/trailer"
39
36
  statement: |
40
37
  The `Irregular_Series.trailer` attribute shall be implemented as an instance
41
38
  of SeriesTrailer.
39
+ obligation: requirement
@@ -1,16 +1,13 @@
1
1
  ---
2
2
  normative_statements_classes:
3
3
  - name: JSON encoding of Regular Series SDU
4
- identifier: /req/series-regular-encoding-json
5
- description: |
6
- Requirements for the JSON encoding of a Regular Series SDU.
4
+ identifier: "/req/series-regular-encoding-json"
5
+ description: 'Requirements for the JSON encoding of a Regular Series SDU.'
7
6
  implements:
8
- - /req/series-regular
9
-
7
+ - "/req/series-regular"
10
8
  normative_statements:
11
-
12
9
  - name: Specification as JSON schema
13
- identifier: /req/series-regular-encoding-json/definition
10
+ identifier: "/req/series-regular-encoding-json/definition"
14
11
  statement: |
15
12
  A JSON-encoded GeoPose Regular Series SHALL conform to the GeoPose Chain
16
13
  JSON-Schema 2019-9 definition (<<regular_series_json_schema>>).
@@ -18,3 +15,4 @@ normative_statements_classes:
18
15
  - |
19
16
  This JSON encoding is extensible because the JSON-Schema
20
17
  "additionalProperties" property is set to the default value of *true*.
18
+ obligation: requirement
@@ -1,46 +1,44 @@
1
1
  ---
2
2
  normative_statements_classes:
3
3
  - name: Regular_Series logical model SDU
4
- identifier: /req/series-regular
4
+ identifier: "/req/series-regular"
5
5
  description: |
6
6
  The Regular_Series Target represents the time evolution of a single GeoPose,
7
7
  with a constant time duration between successive inner frames.
8
-
9
8
  dependencies:
10
- - /req/global
11
- - /req/frame-spec
12
- - /req/time
13
-
9
+ - "/req/global"
10
+ - "/req/frame-spec"
11
+ - "/req/time"
14
12
  normative_statements:
15
-
16
13
  - name: Expression of duration as GeoPose_Duration
17
- identifier: /req/series-regular/duration
14
+ identifier: "/req/series-regular/duration"
18
15
  dependencies:
19
- - /req/time/duration
16
+ - "/req/time/duration"
20
17
  statement: |
21
18
  The `Regular_Series.interPoseDuration` attribute shall be represented by
22
19
  an instance of the `GeoPose_Duration` object.
23
-
20
+ obligation: requirement
24
21
  - name: Expression of outer frame
25
- identifier: /req/series-regular/outer-frame
22
+ identifier: "/req/series-regular/outer-frame"
26
23
  statement: |
27
24
  The `Regular_Series.outerFrame` attribute shall represent the first frame
28
25
  in the series with the `ExplicitFrameSpec` object.
29
-
26
+ obligation: requirement
30
27
  - name: Expression of inner frames
31
- identifier: /req/series-regular/inner-frame-series
28
+ identifier: "/req/series-regular/inner-frame-series"
32
29
  statement: |
33
30
  The `Regular_Series.innerFrameSeries` attribute shall represent the
34
31
  succession of inner frames as an array of `ExplicitFrameSpec` objects.
35
-
32
+ obligation: requirement
36
33
  - name: Expression of series header
37
- identifier: /req/series-regular/header
34
+ identifier: "/req/series-regular/header"
38
35
  statement: |
39
36
  The `Regular_Series.header` attribute shall be implemented as an instance
40
37
  of SeriesHeader.
41
-
38
+ obligation: requirement
42
39
  - name: Expression of series trailer
43
- identifier: /req/series-regular/trailer
40
+ identifier: "/req/series-regular/trailer"
44
41
  statement: |
45
42
  The `Regular_Series.trailer` attribute shall be implemented as an instance
46
43
  of SeriesTrailer.
44
+ obligation: requirement
@@ -1,22 +1,19 @@
1
1
  ---
2
2
  normative_statements_classes:
3
3
  - name: JSON encoding of Stream SDUs
4
- identifier: /req/stream-encoding-json
5
- description: |
6
- Requirements for the JSON encoding of Stream SDUs.
4
+ identifier: "/req/stream-encoding-json"
5
+ description: 'Requirements for the JSON encoding of Stream SDUs.'
7
6
  implements:
8
- - /req/stream
9
-
7
+ - "/req/stream"
10
8
  normative_statements:
11
-
12
9
  - name: Stream Element specification as JSON schema
13
- identifier: /req/stream-encoding-json/element
10
+ identifier: "/req/stream-encoding-json/element"
14
11
  statement: |
15
12
  A JSON-encoded GeoPose Stream Element SHALL conform to the GeoPose Stream Element
16
13
  JSON-Schema 2019-9 definition (<<streamelement_json_schema>>).
17
-
14
+ obligation: requirement
18
15
  - name: Stream Header specification as JSON schema
19
- identifier: /req/stream-encoding-json/header
16
+ identifier: "/req/stream-encoding-json/header"
20
17
  statement: |
21
18
  A JSON-encoded GeoPose Stream Element SHALL conform to the GeoPose Stream Header
22
19
  JSON-Schema 2019-9 definition (<<streamheader_json_schema>>).
@@ -24,9 +21,10 @@ normative_statements_classes:
24
21
  - |
25
22
  This JSON encoding is extensible because the JSON-Schema
26
23
  "additionalProperties" property is set to the default value of *true*.
27
-
24
+ obligation: requirement
28
25
  - name: Stream Record specification as JSON schema
29
- identifier: /req/stream-encoding-json/record
26
+ identifier: "/req/stream-encoding-json/record"
30
27
  statement: |
31
28
  A JSON-encoded GeoPose Stream Record (a recorded Stream) SHALL conform to the GeoPose Stream Record
32
29
  JSON-Schema 2019-9 definition (<<streamrecord_json_schema>>).
30
+ obligation: requirement
@@ -1,36 +1,34 @@
1
1
  ---
2
2
  normative_statements_classes:
3
3
  - name: StreamHeader and StreamElement logical model SDUs
4
- identifier: /req/stream
4
+ identifier: "/req/stream"
5
5
  description: |
6
6
  The Stream target supports a network of object relative poses. The graph is a
7
7
  directed acyclic graph, each node must either be an Extrinsic Frame or
8
8
  reachable from an Extrinsic Frame.
9
-
10
9
  dependencies:
11
- - /req/global
12
- - /req/frame-spec
13
-
10
+ - "/req/global"
11
+ - "/req/frame-spec"
14
12
  normative_statements:
15
-
16
13
  - name: Expression of outer frame in StreamHeader
17
- identifier: /req/stream/header-initial-frame
14
+ identifier: "/req/stream/header-initial-frame"
18
15
  statement: |
19
16
  The `StreamHeader.outerFrame` attribute shall represent the initial frame
20
17
  of the stream with a value that is an instant of the `ExplicitFrameSpec`
21
18
  object.
22
-
19
+ obligation: requirement
23
20
  - name: Expression of transition model in StreamHeader
24
- identifier: /req/stream/header-transition-model
21
+ identifier: "/req/stream/header-transition-model"
25
22
  statement: |
26
23
  The `StreamHeader.transitionModel` attribute shall have a value that is
27
24
  an instance of the `TransitionModel` enumeration.
28
-
25
+ obligation: requirement
29
26
  - name: Expression of stream elements in StreamElement
30
- identifier: /req/stream/element
27
+ identifier: "/req/stream/element"
31
28
  dependencies:
32
- - /req/time/instant
29
+ - "/req/time/instant"
33
30
  statement: |
34
31
  The `StreamElement.streamElement` attribute shall be implemented as an
35
32
  array of `FrameAndTimeElement` objects, each of which is a pair of
36
33
  `ExplicitFrameSpec` and `GeoPoseInstant` objects.
34
+ obligation: requirement
@@ -1,38 +1,37 @@
1
1
  ---
2
2
  normative_statements_classes:
3
3
  - name: Tangent point requirements
4
- identifier: /req/tangent-point
5
- description: |
6
- Common tangent point requirements for SDUs that include tangent points.
7
- guidance: |
4
+ identifier: "/req/tangent-point"
5
+ description: 'Common tangent point requirements for SDUs that include tangent points.'
6
+ guidance:
7
+ - |-
8
8
  The tangent plane `longitude`, `latitude`, and `h` parameters are
9
9
  specified without any conditions or constraints on precision to be used in
10
10
  an implementation. Any such constraints would be found as requirements on a
11
11
  specific implementation as an encoding.
12
-
13
12
  normative_statements:
14
-
15
13
  - name: Tangent point height value specification
16
- identifier: /req/tangent-point/height
14
+ identifier: "/req/tangent-point/height"
17
15
  statement: |
18
16
  An instance of a GeoPose `tangentPoint.h` attribute SHALL be expressed as
19
17
  a height in meters above the WGS-84 ellipsoid, represented as a signed as
20
18
  a signed floating point value conforming to IEEE 754. If the tangent point
21
19
  is above the WGS-84 ellipsoid, the value SHALL be positive. If the tangent
22
20
  point is below the WGS-84 ellipsoid, the value SHALL be negative.
23
-
21
+ obligation: requirement
24
22
  - name: Tangent point latitude value specification
25
- identifier: /req/tangent-point/latitude
23
+ identifier: "/req/tangent-point/latitude"
26
24
  statement: |
27
25
  An instance of GeoPose tangentPoint.latitude attribute SHALL be expressed
28
26
  as decimal degrees and represented as a signed floating point
29
27
  value conforming to IEEE 754.. The minimum value shall be 90.0 degrees
30
28
  and the maximum value shall be 90.0 degrees.
31
-
29
+ obligation: requirement
32
30
  - name: Tangent point longitude value specification
33
- identifier: /req/tangent-point/longitude
31
+ identifier: "/req/tangent-point/longitude"
34
32
  statement: |
35
33
  An instance of a GeoPose tangentPoint.longitude attribute SHALL be
36
34
  expressed as decimal degrees and represented as a signed floating point
37
35
  value conforming to IEEE 754. The minimum value shall be -180.0 degrees
38
36
  and the maximum value shall be 180.0 degrees.
37
+ obligation: requirement
@@ -1,20 +1,18 @@
1
1
  ---
2
2
  normative_statements_classes:
3
3
  - name: Time specification requirements
4
- identifier: /req/time
5
- description: |
6
- Requirements on GeoPose time-related objects.
7
-
4
+ identifier: "/req/time"
5
+ description: 'Requirements on GeoPose time-related objects.'
8
6
  normative_statements:
9
-
10
7
  - name: Implementation of GeoPose_Instant
11
- identifier: /req/time/instant
8
+ identifier: "/req/time/instant"
12
9
  statement: |
13
10
  The `GeoPose_Instant` object shall express Unix Time in seconds multiplied
14
11
  by 1,000, with the unit of measure in milliseconds.
15
-
12
+ obligation: requirement
16
13
  - name: Implementation of GeoPose_Duration
17
- identifier: /req/time/duration
14
+ identifier: "/req/time/duration"
18
15
  statement: |
19
16
  The `GeoPose_Duration` object shall express time in seconds multiplied by
20
17
  1,000, with the unit of measure in milliseconds.
18
+ obligation: requirement
@@ -11,19 +11,19 @@ RSpec.describe Modspec::ConformanceClass do
11
11
  Modspec::NormativeStatement.new(
12
12
  identifier: "/req/basic-ypr/position",
13
13
  name: "Expression of outer frame",
14
- statement: "The `Basic_YPR.position` attribute shall represent the outer frame, specified by an implicit WGS-84 CRS and an implicit EPSG 4461-CS (LTP-ENU) coordinate system and explicit parameters to define the tangent point."
14
+ statement: "The `Basic_YPR.position` attribute shall represent the outer frame.",
15
15
  ),
16
16
  Modspec::NormativeStatement.new(
17
17
  identifier: "/req/basic-ypr/angles",
18
18
  name: "Expression of inner frame",
19
- statement: "The `Basic_YPR.angles` attribute shall represent the inner frame, which is a rotation-only transformation with Yaw, Pitch, and Roll (YPR) angles."
20
- )
21
- ]
19
+ statement: "The `Basic_YPR.angles` attribute shall represent the inner frame.",
20
+ ),
21
+ ],
22
22
  )
23
23
  end
24
24
 
25
25
  let(:conformance_class) do
26
- Modspec::ConformanceClass.new(
26
+ described_class.new(
27
27
  identifier: "/conf/basic-ypr",
28
28
  name: "Basic-YPR logical model SDU conformance",
29
29
  target: ["/req/basic-ypr"],
@@ -35,19 +35,19 @@ RSpec.describe Modspec::ConformanceClass do
35
35
  identifier: "/conf/basic-ypr/position",
36
36
  name: "Verify expression of outer frame",
37
37
  targets: ["/req/basic-ypr/position"],
38
- description: "To confirm that an implementation of a Basic-YPR consists of an Outer Frame specified by an implicit WGS-84 CRS and an implicit EPSG 4461-CS (LTP-ENU) coordinate system and explicit parameters to define the tangent point.",
38
+ description: "To confirm outer frame.",
39
39
  purpose: "Verify that this requirement is satisfied.",
40
- method: "Inspection"
40
+ test_method: "Inspection",
41
41
  ),
42
42
  Modspec::ConformanceTest.new(
43
43
  identifier: "/conf/basic-ypr/angles",
44
44
  name: "Verify expression of inner frame",
45
45
  targets: ["/req/basic-ypr/angles"],
46
- description: "To confirm that the Inner Frame is expressed as a rotation-only transformation using Yaw, Pitch, and Roll angles.",
46
+ description: "To confirm inner frame.",
47
47
  purpose: "Verify that this requirement is satisfied.",
48
- method: "Inspection"
49
- )
50
- ]
48
+ test_method: "Inspection",
49
+ ),
50
+ ],
51
51
  )
52
52
  end
53
53
 
@@ -59,9 +59,9 @@ RSpec.describe Modspec::ConformanceClass do
59
59
  Modspec::NormativeStatement.new(
60
60
  identifier: "/req/global/sdu",
61
61
  name: "SDU conformance",
62
- statement: "SDUs shall conform to the logical model."
63
- )
64
- ]
62
+ statement: "SDUs shall conform to the logical model.",
63
+ ),
64
+ ],
65
65
  )
66
66
  end
67
67
 
@@ -73,14 +73,14 @@ RSpec.describe Modspec::ConformanceClass do
73
73
  Modspec::NormativeStatement.new(
74
74
  identifier: "/req/tangent-point/height",
75
75
  name: "Tangent point height",
76
- statement: "Tangent point height shall be specified."
77
- )
78
- ]
76
+ statement: "Tangent point height shall be specified.",
77
+ ),
78
+ ],
79
79
  )
80
80
  end
81
81
 
82
82
  let(:global_conf_class) do
83
- Modspec::ConformanceClass.new(
83
+ described_class.new(
84
84
  identifier: "/conf/global",
85
85
  name: "Global conformance",
86
86
  tests: [
@@ -88,16 +88,16 @@ RSpec.describe Modspec::ConformanceClass do
88
88
  identifier: "/conf/global/sdu",
89
89
  name: "Verify SDU conformance",
90
90
  targets: ["/req/global/sdu"],
91
- description: "To confirm that an implementation of an SDU conforms to the logical model.",
91
+ description: "To confirm SDU conformance.",
92
92
  purpose: "Verify that this requirement is satisfied.",
93
- method: "Inspection"
94
- )
95
- ]
93
+ test_method: "Inspection",
94
+ ),
95
+ ],
96
96
  )
97
97
  end
98
98
 
99
99
  let(:tangent_point_conf_class) do
100
- Modspec::ConformanceClass.new(
100
+ described_class.new(
101
101
  identifier: "/conf/tangent-point",
102
102
  name: "Tangent point conformance",
103
103
  tests: [
@@ -105,19 +105,20 @@ RSpec.describe Modspec::ConformanceClass do
105
105
  identifier: "/conf/tangent-point/height",
106
106
  name: "Verify tangent point height",
107
107
  targets: ["/req/tangent-point/height"],
108
- description: "To confirm that an implementation of a Tangent Point specifies the height of the Tangent Point.",
108
+ description: "To confirm tangent point height.",
109
109
  purpose: "Verify that this requirement is satisfied.",
110
- method: "Inspection"
111
- )
112
-
113
- ]
110
+ test_method: "Inspection",
111
+ ),
112
+ ],
114
113
  )
115
114
  end
116
115
 
117
116
  let(:suite) do
118
117
  suite = Modspec::Suite.new
119
- suite.conformance_classes = [conformance_class, global_conf_class, tangent_point_conf_class]
120
- suite.normative_statements_classes = [normative_statements_class, global_class, tangent_point_class]
118
+ suite.conformance_classes = [conformance_class, global_conf_class,
119
+ tangent_point_conf_class]
120
+ suite.normative_statements_classes = [normative_statements_class,
121
+ global_class, tangent_point_class]
121
122
  suite.setup_relationships
122
123
  suite
123
124
  end
@@ -138,17 +139,25 @@ RSpec.describe Modspec::ConformanceClass do
138
139
  describe "#validate" do
139
140
  it "returns no errors for a valid conformance class" do
140
141
  errors = suite.validate
141
- if errors.any?
142
- puts "Validation errors:"
143
- errors.each { |error| puts " #{error}" }
144
- end
145
142
  expect(errors).to be_empty
146
143
  end
147
144
 
148
145
  it "returns errors if there are no conformance tests" do
149
146
  conformance_class.tests = []
150
147
  errors = conformance_class.validate
151
- expect(errors).not_to be_empty
148
+ expect(errors).to include(a_string_matching(/no child conformance tests/))
149
+ end
150
+
151
+ it "returns errors if test identifier does not share prefix" do
152
+ conformance_class.tests = [
153
+ Modspec::ConformanceTest.new(
154
+ identifier: "/conf/other/test",
155
+ name: "Mismatched test",
156
+ targets: ["/req/basic-ypr/position"],
157
+ ),
158
+ ]
159
+ errors = conformance_class.validate
160
+ expect(errors).to include(a_string_matching(/does not share the expected prefix/))
152
161
  end
153
162
  end
154
163
  end