Class: Gitlab::QA::Report::JUnitTestResults

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/gitlab/qa/report/junit_test_results.rb

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ JUnitTestResults

Returns a new instance of JUnitTestResults.



11
12
13
# File 'lib/gitlab/qa/report/junit_test_results.rb', line 11

def initialize(file)
  @testcases = Nokogiri::XML(File.read(file)).xpath('//testcase').map { |test| TestResult.from_junit(test) }
end

Instance Method Details

#each(&block) ⇒ Object



15
16
17
# File 'lib/gitlab/qa/report/junit_test_results.rb', line 15

def each(&block)
  @testcases.each(&block)
end