ci_reporter_test_unit 0.0.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +6 -1
- data/Rakefile +2 -2
- data/acceptance/verification_spec.rb +41 -24
- data/ci_reporter_test_unit.gemspec +4 -2
- data/lib/ci/reporter/test_unit/version.rb +1 -1
- data/spec/ci/reporter/rake/rake_tasks_spec.rb +3 -3
- metadata +37 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: baf21aa21f0dbe32b0f2d3bb1a9730daaf1e5fd6
|
4
|
+
data.tar.gz: 6bec84d8cfba2f964bf63aa84d7a9e6c1d4fdfb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01b4a90a1c080dfced1753ccd94cfeacd317e2922c857b038144ab904ee019be8676e38c8a1ac861574c4fb8b5467f8f53930a21903136fcb6617494603df4be
|
7
|
+
data.tar.gz: 309fa29957e8416c3a33f243bcf84f29ea3d2ca45e5e8e00687c507ba3bb782aeb9f091d2c0a1093bede939e344a0b7dda442a32ec80ff8cf38c8ac470297c9f
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -3,6 +3,11 @@
|
|
3
3
|
Connects [Test::Unit][tu] to [CI::Reporter][ci], and then to your CI
|
4
4
|
system.
|
5
5
|
|
6
|
+
[![Gem Version](https://badge.fury.io/rb/ci_reporter_test_unit.svg)](http://badge.fury.io/rb/ci_reporter_test_unit)
|
7
|
+
[![Build Status](https://travis-ci.org/ci-reporter/ci_reporter_test_unit.svg?branch=master)](https://travis-ci.org/ci-reporter/ci_reporter_test_unit)
|
8
|
+
[![Dependency Status](https://gemnasium.com/ci-reporter/ci_reporter_test_unit.svg)](https://gemnasium.com/ci-reporter/ci_reporter_test_unit)
|
9
|
+
[![Code Climate](https://codeclimate.com/github/ci-reporter/ci_reporter_test_unit.png)](https://codeclimate.com/github/ci-reporter/ci_reporter_test_unit)
|
10
|
+
|
6
11
|
[tu]: http://www.ruby-doc.org/stdlib-2.1.2/libdoc/test/unit/rdoc/Test/Unit.html
|
7
12
|
[ci]: https://github.com/ci-reporter/ci_reporter
|
8
13
|
|
@@ -27,7 +32,7 @@ $ bundle
|
|
27
32
|
## Usage
|
28
33
|
|
29
34
|
Require the reporter in your Rakefile, and ensure that
|
30
|
-
`ci:setup:testunit` is a dependency of your
|
35
|
+
`ci:setup:testunit` is a dependency of your Test::Unit task:
|
31
36
|
|
32
37
|
```ruby
|
33
38
|
require 'ci/reporter/rake/test_unit'
|
data/Rakefile
CHANGED
@@ -1,38 +1,55 @@
|
|
1
1
|
require 'rexml/document'
|
2
|
+
require 'ci/reporter/test_utils/accessor'
|
3
|
+
require 'ci/reporter/test_utils/shared_examples'
|
4
|
+
require 'rspec/collection_matchers'
|
2
5
|
|
3
6
|
REPORTS_DIR = File.dirname(__FILE__) + '/reports'
|
4
7
|
|
5
8
|
describe "Test::Unit acceptance" do
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
+
include CI::Reporter::TestUtils::SharedExamples
|
10
|
+
Accessor = CI::Reporter::TestUtils::Accessor
|
11
|
+
|
12
|
+
let(:report_path1) { File.join(REPORTS_DIR, 'TEST-TestUnitExampleTestOne.xml') }
|
13
|
+
let(:report_path2) { File.join(REPORTS_DIR, 'TEST-TestUnitExampleTestTwo.xml') }
|
14
|
+
|
15
|
+
context "the first example" do
|
16
|
+
subject(:result) { Accessor.new(load_xml_result(report_path1)) }
|
17
|
+
|
18
|
+
it { is_expected.to have(1).errors }
|
19
|
+
it { is_expected.to have(1).failures }
|
20
|
+
it { is_expected.to have(1).testcases }
|
21
|
+
|
22
|
+
describe "the assertion count" do
|
23
|
+
subject { result.assertions_count }
|
24
|
+
it { is_expected.to eql 1 }
|
25
|
+
end
|
26
|
+
|
27
|
+
it "captures the STDOUT" do
|
28
|
+
expect(result.system_out).to eql "Some <![CDATA[on stdout]]>"
|
29
|
+
end
|
30
|
+
|
31
|
+
it_behaves_like "a report with consistent attribute counts"
|
9
32
|
end
|
10
33
|
|
11
|
-
|
12
|
-
|
13
|
-
|
34
|
+
context "the second example" do
|
35
|
+
subject(:result) { Accessor.new(load_xml_result(report_path2)) }
|
36
|
+
|
37
|
+
it { is_expected.to have(0).errors }
|
38
|
+
it { is_expected.to have(0).failures }
|
39
|
+
it { is_expected.to have(1).testcases }
|
40
|
+
|
41
|
+
describe "the assertion count" do
|
42
|
+
subject { result.assertions_count }
|
43
|
+
it { is_expected.to eql 1 }
|
14
44
|
end
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
doc.root.attributes["tests"].should == "1"
|
19
|
-
doc.root.elements.to_a("/testsuite/testcase").size.should == 1
|
20
|
-
doc.root.elements.to_a("/testsuite/testcase/error").size.should == 1
|
21
|
-
doc.root.elements.to_a("/testsuite/testcase/failure").size.should == 1
|
22
|
-
doc.root.elements.to_a("/testsuite/system-out").first.texts.inject("") do |c,e|
|
23
|
-
c << e.value; c
|
24
|
-
end.strip.should == "Some <![CDATA[on stdout]]>"
|
45
|
+
|
46
|
+
it_behaves_like "a report with consistent attribute counts"
|
47
|
+
it_behaves_like "nothing was output"
|
25
48
|
end
|
26
49
|
|
27
|
-
|
28
|
-
|
50
|
+
def load_xml_result(path)
|
51
|
+
File.open(path) do |f|
|
29
52
|
REXML::Document.new(f)
|
30
53
|
end
|
31
|
-
doc.root.attributes["errors"].should == "0"
|
32
|
-
doc.root.attributes["failures"].should == "0"
|
33
|
-
doc.root.attributes["assertions"].should == "1"
|
34
|
-
doc.root.attributes["tests"].should == "1"
|
35
|
-
doc.root.elements.to_a("/testsuite/testcase").size.should == 1
|
36
|
-
doc.root.elements.to_a("/testsuite/testcase/failure").size.should == 0
|
37
54
|
end
|
38
55
|
end
|
@@ -18,9 +18,11 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
20
|
spec.add_dependency "test-unit", "~> 2.5.5"
|
21
|
-
spec.add_dependency "ci_reporter", "2.0
|
21
|
+
spec.add_dependency "ci_reporter", "~> 2.0"
|
22
22
|
|
23
23
|
spec.add_development_dependency "bundler", "~> 1.6"
|
24
24
|
spec.add_development_dependency "rake"
|
25
|
-
spec.add_development_dependency "rspec", "~>
|
25
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
26
|
+
spec.add_development_dependency "rspec-collection_matchers"
|
27
|
+
spec.add_development_dependency "ci_reporter_test_utils"
|
26
28
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require File.dirname(__FILE__) + "/../../../spec_helper.rb"
|
2
2
|
require 'rake'
|
3
|
-
|
4
|
-
require 'ci/reporter/internal'
|
5
|
-
include CI::Reporter::Internal
|
3
|
+
require 'ci/reporter/test_utils/unit'
|
6
4
|
|
7
5
|
describe "ci_reporter ci:setup:testunit task" do
|
6
|
+
include CI::Reporter::TestUtils::Unit
|
7
|
+
|
8
8
|
before(:each) do
|
9
9
|
@rake = Rake::Application.new
|
10
10
|
Rake.application = @rake
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ci_reporter_test_unit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
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-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: test-unit
|
@@ -29,16 +29,16 @@ dependencies:
|
|
29
29
|
name: ci_reporter
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- -
|
32
|
+
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: 2.0
|
34
|
+
version: '2.0'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: 2.0
|
41
|
+
version: '2.0'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: bundler
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -73,14 +73,42 @@ dependencies:
|
|
73
73
|
requirements:
|
74
74
|
- - "~>"
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: '
|
76
|
+
version: '3.0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
81
|
- - "~>"
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version: '
|
83
|
+
version: '3.0'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: rspec-collection_matchers
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
type: :development
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: ci_reporter_test_utils
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
type: :development
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
84
112
|
description:
|
85
113
|
email:
|
86
114
|
- nick@nicksieger.com
|
@@ -91,6 +119,7 @@ extra_rdoc_files: []
|
|
91
119
|
files:
|
92
120
|
- ".gitignore"
|
93
121
|
- ".travis.yml"
|
122
|
+
- CHANGELOG.md
|
94
123
|
- Gemfile
|
95
124
|
- LICENSE.txt
|
96
125
|
- README.md
|