module CI::Reporter::StructureXmlHelpers
Public Instance Methods
Source
# File lib/ci/reporter/test_suite.rb, line 10 def attr_hash Hash[self.members.zip(self.values)] end
Struct#to_h is not available in Ruby 1.9
Source
# File lib/ci/reporter/test_suite.rb, line 15 def cleaned_attributes attr_array = attr_hash .reject {|k,v| v.to_s.empty? } .map {|k,v| [k, truncate_at_newline(v)] } Hash[attr_array] end
Removes empty attributes and truncates long attributes.
Source
# File lib/ci/reporter/test_suite.rb, line 22 def truncate_at_newline(txt) txt.to_s.sub(/\n.*/m, '...') end