Class: Ace::Test::EndToEndRunner::Models::TestCase
- Inherits:
-
Object
- Object
- Ace::Test::EndToEndRunner::Models::TestCase
- Defined in:
- lib/ace/test/end_to_end_runner/models/test_case.rb
Overview
Data model representing a single test case definition.
Contains parsed frontmatter metadata and the full markdown body from an independent test case file within a scenario directory.
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#declared_artifacts ⇒ Object
readonly
Returns the value of attribute declared_artifacts.
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
-
#goal_format ⇒ Object
readonly
Returns the value of attribute goal_format.
-
#optional_artifacts ⇒ Object
readonly
Returns the value of attribute optional_artifacts.
-
#pending ⇒ Object
readonly
Returns the value of attribute pending.
-
#tc_id ⇒ Object
readonly
Returns the value of attribute tc_id.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(tc_id:, title:, content:, file_path:, pending: nil, goal_format: nil, declared_artifacts: [], optional_artifacts: []) ⇒ TestCase
constructor
A new instance of TestCase.
-
#pending? ⇒ Boolean
Whether this test case is pending (should be skipped).
-
#short_id ⇒ String
Generate short test case ID for directory naming.
Constructor Details
#initialize(tc_id:, title:, content:, file_path:, pending: nil, goal_format: nil, declared_artifacts: [], optional_artifacts: []) ⇒ TestCase
Returns a new instance of TestCase.
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/ace/test/end_to_end_runner/models/test_case.rb', line 23 def initialize(tc_id:, title:, content:, file_path:, pending: nil, goal_format: nil, declared_artifacts: [], optional_artifacts: []) @tc_id = tc_id @title = title @content = content @file_path = file_path @pending = pending @goal_format = goal_format @declared_artifacts = declared_artifacts @optional_artifacts = optional_artifacts end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
12 13 14 |
# File 'lib/ace/test/end_to_end_runner/models/test_case.rb', line 12 def content @content end |
#declared_artifacts ⇒ Object (readonly)
Returns the value of attribute declared_artifacts.
12 13 14 |
# File 'lib/ace/test/end_to_end_runner/models/test_case.rb', line 12 def declared_artifacts @declared_artifacts end |
#file_path ⇒ Object (readonly)
Returns the value of attribute file_path.
12 13 14 |
# File 'lib/ace/test/end_to_end_runner/models/test_case.rb', line 12 def file_path @file_path end |
#goal_format ⇒ Object (readonly)
Returns the value of attribute goal_format.
12 13 14 |
# File 'lib/ace/test/end_to_end_runner/models/test_case.rb', line 12 def goal_format @goal_format end |
#optional_artifacts ⇒ Object (readonly)
Returns the value of attribute optional_artifacts.
12 13 14 |
# File 'lib/ace/test/end_to_end_runner/models/test_case.rb', line 12 def optional_artifacts @optional_artifacts end |
#pending ⇒ Object (readonly)
Returns the value of attribute pending.
12 13 14 |
# File 'lib/ace/test/end_to_end_runner/models/test_case.rb', line 12 def pending @pending end |
#tc_id ⇒ Object (readonly)
Returns the value of attribute tc_id.
12 13 14 |
# File 'lib/ace/test/end_to_end_runner/models/test_case.rb', line 12 def tc_id @tc_id end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
12 13 14 |
# File 'lib/ace/test/end_to_end_runner/models/test_case.rb', line 12 def title @title end |
Instance Method Details
#pending? ⇒ Boolean
Whether this test case is pending (should be skipped)
37 38 39 |
# File 'lib/ace/test/end_to_end_runner/models/test_case.rb', line 37 def pending? !pending.nil? end |
#short_id ⇒ String
Generate short test case ID for directory naming
43 44 45 46 47 48 |
# File 'lib/ace/test/end_to_end_runner/models/test_case.rb', line 43 def short_id match = tc_id.match(/TC-(\d+[a-z]*)/i) return "tc#{match[1]}" if match tc_id.downcase.gsub(/[^a-z0-9]/, "") end |