Class: RSSNotification::UnitTestResult
- Inherits:
-
Object
- Object
- RSSNotification::UnitTestResult
- Defined in:
- lib/kwala/notifications/rss.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#first_seen ⇒ Object
readonly
Returns the value of attribute first_seen.
-
#last_seen ⇒ Object
Returns the value of attribute last_seen.
-
#test_results ⇒ Object
readonly
Returns the value of attribute test_results.
-
#warnings ⇒ Object
readonly
Returns the value of attribute warnings.
Instance Method Summary collapse
- #==(obj) ⇒ Object
-
#initialize(result_hash, timestamp) ⇒ UnitTestResult
constructor
A new instance of UnitTestResult.
- #pass? ⇒ Boolean
- #to_rss_item(compare_timestamp) ⇒ Object
Constructor Details
#initialize(result_hash, timestamp) ⇒ UnitTestResult
Returns a new instance of UnitTestResult.
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/kwala/notifications/rss.rb', line 24 def initialize(result_hash, ) @filename = result_hash[:file_name] @errors = result_hash[:sys_errors] @warnings = result_hash[:warnings] @first_seen = @last_seen = @test_results = Hash.new result_hash[:version].each do |r| if !r[:test_results].empty? @test_results[r[:version_name]] = r[:test_results] end end end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
21 22 23 |
# File 'lib/kwala/notifications/rss.rb', line 21 def errors @errors end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
21 22 23 |
# File 'lib/kwala/notifications/rss.rb', line 21 def filename @filename end |
#first_seen ⇒ Object (readonly)
Returns the value of attribute first_seen.
21 22 23 |
# File 'lib/kwala/notifications/rss.rb', line 21 def first_seen @first_seen end |
#last_seen ⇒ Object
Returns the value of attribute last_seen.
22 23 24 |
# File 'lib/kwala/notifications/rss.rb', line 22 def last_seen @last_seen end |
#test_results ⇒ Object (readonly)
Returns the value of attribute test_results.
21 22 23 |
# File 'lib/kwala/notifications/rss.rb', line 21 def test_results @test_results end |
#warnings ⇒ Object (readonly)
Returns the value of attribute warnings.
21 22 23 |
# File 'lib/kwala/notifications/rss.rb', line 21 def warnings @warnings end |
Instance Method Details
#==(obj) ⇒ Object
42 43 44 45 46 47 48 49 |
# File 'lib/kwala/notifications/rss.rb', line 42 def ==(obj) res = obj.kind_of?(UnitTestResult) res &= obj.filename == @filename res &= obj.errors == @errors res &= obj.warnings == @warnings res &= obj.test_results == @test_results res end |
#pass? ⇒ Boolean
38 39 40 |
# File 'lib/kwala/notifications/rss.rb', line 38 def pass? @errors.empty? && @warnings.empty? && @test_results.empty? end |
#to_rss_item(compare_timestamp) ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/kwala/notifications/rss.rb', line 51 def to_rss_item() if @last_seen < defect_status = "Fixed" else defect_status = "New" end item = RSS::Rss::Channel::Item.new item.title = "#{@first_seen.strftime("%b %d, %H:%M")} - #{defect_status} defects in #{@filename}" item.pubDate = @first_seen item.description = defect_details_html item end |