Class: Rng::TestSuiteParser::TestCase
- Inherits:
-
Object
- Object
- Rng::TestSuiteParser::TestCase
- Defined in:
- lib/rng/test_suite_parser.rb
Overview
Represents a single test case with RNC and RNG versions
Instance Attribute Summary collapse
-
#compact_correct ⇒ Object
readonly
Returns the value of attribute compact_correct.
-
#compact_incorrect ⇒ Object
readonly
Returns the value of attribute compact_incorrect.
-
#compact_resources ⇒ Object
readonly
Returns the value of attribute compact_resources.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#xml_correct ⇒ Object
readonly
Returns the value of attribute xml_correct.
-
#xml_incorrect ⇒ Object
readonly
Returns the value of attribute xml_incorrect.
-
#xml_resources ⇒ Object
readonly
Returns the value of attribute xml_resources.
Instance Method Summary collapse
- #description ⇒ Object
- #has_resources? ⇒ Boolean
-
#initialize(id:) ⇒ TestCase
constructor
A new instance of TestCase.
- #invalid_rnc? ⇒ Boolean
- #valid_rnc? ⇒ Boolean
- #valid_rng? ⇒ Boolean
Constructor Details
#initialize(id:) ⇒ TestCase
Returns a new instance of TestCase.
14 15 16 17 18 19 20 21 22 |
# File 'lib/rng/test_suite_parser.rb', line 14 def initialize(id:) @id = id @compact_correct = nil @compact_incorrect = nil @xml_correct = nil @xml_incorrect = nil @compact_resources = {} @xml_resources = {} end |
Instance Attribute Details
#compact_correct ⇒ Object (readonly)
Returns the value of attribute compact_correct.
10 11 12 |
# File 'lib/rng/test_suite_parser.rb', line 10 def compact_correct @compact_correct end |
#compact_incorrect ⇒ Object (readonly)
Returns the value of attribute compact_incorrect.
10 11 12 |
# File 'lib/rng/test_suite_parser.rb', line 10 def compact_incorrect @compact_incorrect end |
#compact_resources ⇒ Object (readonly)
Returns the value of attribute compact_resources.
10 11 12 |
# File 'lib/rng/test_suite_parser.rb', line 10 def compact_resources @compact_resources end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
10 11 12 |
# File 'lib/rng/test_suite_parser.rb', line 10 def id @id end |
#xml_correct ⇒ Object (readonly)
Returns the value of attribute xml_correct.
10 11 12 |
# File 'lib/rng/test_suite_parser.rb', line 10 def xml_correct @xml_correct end |
#xml_incorrect ⇒ Object (readonly)
Returns the value of attribute xml_incorrect.
10 11 12 |
# File 'lib/rng/test_suite_parser.rb', line 10 def xml_incorrect @xml_incorrect end |
#xml_resources ⇒ Object (readonly)
Returns the value of attribute xml_resources.
10 11 12 |
# File 'lib/rng/test_suite_parser.rb', line 10 def xml_resources @xml_resources end |
Instance Method Details
#description ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/rng/test_suite_parser.rb', line 40 def description if valid_rnc? && valid_rng? 'RNC ↔ RNG conversion' elsif valid_rnc? 'Valid RNC parsing' elsif invalid_rnc? 'Invalid RNC rejection' else 'Test case' end end |
#has_resources? ⇒ Boolean
36 37 38 |
# File 'lib/rng/test_suite_parser.rb', line 36 def has_resources? !compact_resources.empty? || !xml_resources.empty? end |
#invalid_rnc? ⇒ Boolean
28 29 30 |
# File 'lib/rng/test_suite_parser.rb', line 28 def invalid_rnc? !compact_incorrect.nil? end |
#valid_rnc? ⇒ Boolean
24 25 26 |
# File 'lib/rng/test_suite_parser.rb', line 24 def valid_rnc? !compact_correct.nil? end |
#valid_rng? ⇒ Boolean
32 33 34 |
# File 'lib/rng/test_suite_parser.rb', line 32 def valid_rng? !xml_correct.nil? end |