Class: CI::Reporter::TestUtils::Accessor
- Inherits:
-
Object
- Object
- CI::Reporter::TestUtils::Accessor
show all
- Defined in:
- lib/ci/reporter/test_utils/accessor.rb
Defined Under Namespace
Classes: Error, Failure, Testcase
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(xml) ⇒ Accessor
Returns a new instance of Accessor.
33
34
35
|
# File 'lib/ci/reporter/test_utils/accessor.rb', line 33
def initialize(xml)
@root = xml.root
end
|
Instance Attribute Details
#root ⇒ Object
Returns the value of attribute root.
5
6
7
|
# File 'lib/ci/reporter/test_utils/accessor.rb', line 5
def root
@root
end
|
Instance Method Details
#errors ⇒ Object
41
42
43
|
# File 'lib/ci/reporter/test_utils/accessor.rb', line 41
def errors
root.elements.to_a("/testsuite/testcase/error").map {|e| Error.new(e) }
end
|
#failures ⇒ Object
37
38
39
|
# File 'lib/ci/reporter/test_utils/accessor.rb', line 37
def failures
root.elements.to_a("/testsuite/testcase/failure").map {|f| Failure.new(f) }
end
|
#system_err ⇒ Object
63
64
65
|
# File 'lib/ci/reporter/test_utils/accessor.rb', line 63
def system_err
all_text_nodes_as_string("/testsuite/system-err")
end
|
#system_out ⇒ Object
59
60
61
|
# File 'lib/ci/reporter/test_utils/accessor.rb', line 59
def system_out
all_text_nodes_as_string("/testsuite/system-out")
end
|
#testcase(name) ⇒ Object
49
50
51
|
# File 'lib/ci/reporter/test_utils/accessor.rb', line 49
def testcase(name)
testcases.select {|tc| tc.name == name }.first
end
|
#testcases ⇒ Object
45
46
47
|
# File 'lib/ci/reporter/test_utils/accessor.rb', line 45
def testcases
root.elements.to_a("/testsuite/testcase").map {|tc| Testcase.new(tc) }
end
|