ci_reporter_test_utils 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b60ae789246e60b410345398a2dd35eab1b7b17c
|
4
|
+
data.tar.gz: b52360f36968a981bfe519829c622f61a13b57cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a7bcc1e65ab8ee5dc7227fa51564a8e4d1786904eac832c00f7f9b321a0063b9d79efd92b75ee872221970a76cc120317c46a3eb167c3337541e7815b9ee1b6
|
7
|
+
data.tar.gz: 1dce8e7e562108620206c02ba2173dcf8ddd1707f555281267711ef60f56b18678fac41e0f70ca2b914c7420a379afd99dbfa2ce300d8168eb5a5381e76acbc7
|
@@ -4,12 +4,28 @@ module CI::Reporter::TestUtils
|
|
4
4
|
class Accessor
|
5
5
|
attr_reader :root
|
6
6
|
|
7
|
+
Failure = Struct.new(:xml) do
|
8
|
+
def type
|
9
|
+
xml.attributes['type']
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
Testcase = Struct.new(:xml) do
|
14
|
+
def name
|
15
|
+
xml.attributes['name']
|
16
|
+
end
|
17
|
+
|
18
|
+
def failures
|
19
|
+
xml.elements.to_a('failure').map {|f| Failure.new(f) }
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
7
23
|
def initialize(xml)
|
8
24
|
@root = xml.root
|
9
25
|
end
|
10
26
|
|
11
27
|
def failures
|
12
|
-
root.elements.to_a("/testsuite/testcase/failure")
|
28
|
+
root.elements.to_a("/testsuite/testcase/failure").map {|f| Failure.new(f) }
|
13
29
|
end
|
14
30
|
|
15
31
|
def errors
|
@@ -17,7 +33,11 @@ module CI::Reporter::TestUtils
|
|
17
33
|
end
|
18
34
|
|
19
35
|
def testcases
|
20
|
-
root.elements.to_a("/testsuite/testcase")
|
36
|
+
root.elements.to_a("/testsuite/testcase").map {|tc| Testcase.new(tc) }
|
37
|
+
end
|
38
|
+
|
39
|
+
def testcase(name)
|
40
|
+
testcases.select {|tc| tc.name == name }.first
|
21
41
|
end
|
22
42
|
|
23
43
|
[:failures, :errors, :skipped, :assertions, :tests].each do |attr|
|
@@ -30,5 +30,12 @@ module CI::Reporter::TestUtils
|
|
30
30
|
it { should eql result.testcases.count }
|
31
31
|
end
|
32
32
|
end
|
33
|
+
|
34
|
+
shared_examples "assertions are not tracked" do
|
35
|
+
describe "the assertion count" do
|
36
|
+
subject { result.assertions_count }
|
37
|
+
it { should eql 0 }
|
38
|
+
end
|
39
|
+
end
|
33
40
|
end
|
34
41
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ci_reporter_test_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Sieger
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-07-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|