Class: Udb::CertTestProcedure
- Inherits:
-
Object
- Object
- Udb::CertTestProcedure
- Extended by:
- T::Sig
- Defined in:
- lib/udb/cert_test_procedure.rb
Instance Attribute Summary collapse
-
#description ⇒ String
readonly
Description of test procedure (could be multiple lines).
-
#id ⇒ String
readonly
Unique ID of the test procedure.
-
#kind ⇒ String
readonly
What kind of database object is this?.
-
#test_file_name ⇒ String?
readonly
Name of test file that implements this test procedure.
Instance Method Summary collapse
- #cert_normative_rules ⇒ Array<CertNormativeRule>
-
#cert_steps ⇒ String
String (likely multiline) of certification test procedure steps using Asciidoc lists.
- #initialize(data, db_obj) constructor
Constructor Details
#initialize(data, db_obj)
33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/udb/cert_test_procedure.rb', line 33 def initialize(data, db_obj) @data = data @db_obj = db_obj @id = T.must_because(data["id"]) { pp data } @description = T.must_because(data["description"]) { pp data } @kind = T.must_because(db_obj.kind) { pp db_obj } @test_file_name = data["test_file_name"] if test_file_name.nil? warn "Warning: Missing test_file_name for certification test procedure description for ID #{id} of kind #{kind}" end end |
Instance Attribute Details
#description ⇒ String (readonly)
Description of test procedure (could be multiple lines).
20 21 22 |
# File 'lib/udb/cert_test_procedure.rb', line 20 def description @description end |
#id ⇒ String (readonly)
Returns Unique ID of the test procedure.
16 17 18 |
# File 'lib/udb/cert_test_procedure.rb', line 16 def id @id end |
#kind ⇒ String (readonly)
What kind of database object is this?
24 25 26 |
# File 'lib/udb/cert_test_procedure.rb', line 24 def kind @kind end |
#test_file_name ⇒ String? (readonly)
Name of test file that implements this test procedure. Could be nil.
28 29 30 |
# File 'lib/udb/cert_test_procedure.rb', line 28 def test_file_name @test_file_name end |
Instance Method Details
#cert_normative_rules ⇒ Array<CertNormativeRule>
48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/udb/cert_test_procedure.rb', line 48 def cert_normative_rules return @cert_normative_rules unless @cert_normative_rules.nil? @cert_normative_rules = [] @data["normative_rules"]&.each do |id| cp = @db_obj.cert_coverage_point(id) raise ArgumentError, "Can't find certification test procedure with ID '#{id}' for '#{@db_obj.name}' of kind #{@db_obj.kind}" if cp.nil? @cert_normative_rules << cp end @cert_normative_rules end |
#cert_steps ⇒ String
Returns String (likely multiline) of certification test procedure steps using Asciidoc lists.
61 |
# File 'lib/udb/cert_test_procedure.rb', line 61 def cert_steps = @data["steps"] |