Class: CiInACan::TestResult
- Inherits:
-
Object
- Object
- CiInACan::TestResult
- Defined in:
- lib/ci_in_a_can/test_result.rb
Constant Summary collapse
- PERSISTENCE_TYPE =
'test_result'
Instance Attribute Summary collapse
-
#branch ⇒ Object
Returns the value of attribute branch.
-
#build_id ⇒ Object
Returns the value of attribute build_id.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#id ⇒ Object
Returns the value of attribute id.
-
#output ⇒ Object
Returns the value of attribute output.
-
#passed ⇒ Object
Returns the value of attribute passed.
-
#repo ⇒ Object
Returns the value of attribute repo.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#branch ⇒ Object
Returns the value of attribute branch.
16 17 18 |
# File 'lib/ci_in_a_can/test_result.rb', line 16 def branch @branch end |
#build_id ⇒ Object
Returns the value of attribute build_id.
15 16 17 |
# File 'lib/ci_in_a_can/test_result.rb', line 15 def build_id @build_id end |
#created_at ⇒ Object
Returns the value of attribute created_at.
14 15 16 |
# File 'lib/ci_in_a_can/test_result.rb', line 14 def created_at @created_at end |
#id ⇒ Object
Returns the value of attribute id.
12 13 14 |
# File 'lib/ci_in_a_can/test_result.rb', line 12 def id @id end |
#output ⇒ Object
Returns the value of attribute output.
13 14 15 |
# File 'lib/ci_in_a_can/test_result.rb', line 13 def output @output end |
#passed ⇒ Object
Returns the value of attribute passed.
13 14 15 |
# File 'lib/ci_in_a_can/test_result.rb', line 13 def passed @passed end |
#repo ⇒ Object
Returns the value of attribute repo.
17 18 19 |
# File 'lib/ci_in_a_can/test_result.rb', line 17 def repo @repo end |
Class Method Details
.create(values) ⇒ Object
19 20 21 22 23 |
# File 'lib/ci_in_a_can/test_result.rb', line 19 def self.create values test_result = create_the_test_result_from values save_this test_result test_result end |
.find(id) ⇒ Object
25 26 27 |
# File 'lib/ci_in_a_can/test_result.rb', line 25 def self.find id CiInACan::Persistence.find PERSISTENCE_TYPE, id end |
Instance Method Details
#output_summary ⇒ Object
42 43 44 45 46 |
# File 'lib/ci_in_a_can/test_result.rb', line 42 def output_summary output.split("\n") .select { |x| x.to_s.strip != '' } .last end |
#to_html ⇒ Object
38 39 40 |
# File 'lib/ci_in_a_can/test_result.rb', line 38 def to_html CiInACan::ViewModels::TestResultViewModel.new(self).to_html end |
#to_json ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/ci_in_a_can/test_result.rb', line 29 def to_json { id: id, passed: passed, output: output, created_at: created_at }.to_json end |