ci_reporter_test_utils 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a4524dd68b8ca444048a519326c060dd5a995b51
4
- data.tar.gz: e89df200d023e811089918a8e7a2bdb957869204
3
+ metadata.gz: b60ae789246e60b410345398a2dd35eab1b7b17c
4
+ data.tar.gz: b52360f36968a981bfe519829c622f61a13b57cb
5
5
  SHA512:
6
- metadata.gz: fe320dd32c551272e548ee263fe0405dd57860db1ea59ce762c2530f91d3f76c9fed087f3469c56d6192c0b5c4e2a5b11e930fdd6a09bc0f3a359428054533be
7
- data.tar.gz: ef47db94dc3b9813b5c91b111ebeb2845ae16f9542eba0c0bc4534d0342433e1f615be6aaa66be5873f8c389dbe9d054f2e64c2c7b5b77a597517f34f05bfc37
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
@@ -1,7 +1,7 @@
1
1
  module CI
2
2
  module Reporter
3
3
  module TestUtils
4
- VERSION = "0.0.1"
4
+ VERSION = "0.0.2"
5
5
  end
6
6
  end
7
7
  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.1
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-06-30 00:00:00.000000000 Z
12
+ date: 2014-07-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler