probedock-rspec 0.6.0 → 0.7.0
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 +4 -4
- data/Gemfile +2 -2
- data/README.md +45 -26
- data/VERSION +1 -1
- data/lib/probe_dock_rspec/config.rb +10 -2
- data/lib/probe_dock_rspec/formatter.rb +1 -1
- data/lib/probe_dock_rspec/meta_parser.rb +28 -19
- data/lib/probe_dock_rspec.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba8bce3bce5176d6961dfd78fdae77bce895230b
|
4
|
+
data.tar.gz: 0d41a6542f22ea33dafd6a568aedf1813d117008
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d9b15f140d29ba19baf020a257e9af6a5b2887b1df12ab514acb773586d26f8af9b3850420b21cac9a80c987246bc0375a8bf8a3e187361c802ba4d9f4184bf
|
7
|
+
data.tar.gz: 16160c7393aff207214bb62b7209533f872cd3b3e658651fc7c2cfee9084a3f54ecc46be9a028b953dc4eeb2b5589ab6519dc0f4986752fbf265d99930051cb8
|
data/Gemfile
CHANGED
@@ -4,13 +4,13 @@ source "http://rubygems.org"
|
|
4
4
|
# gem "activesupport", ">= 2.3.5"
|
5
5
|
|
6
6
|
gem 'rspec', '~> 3.1'
|
7
|
-
gem 'probedock-ruby', '~> 0.1'
|
7
|
+
gem 'probedock-ruby', '~> 0.2.1'
|
8
8
|
|
9
9
|
# Add dependencies to develop your gem here.
|
10
10
|
# Include everything needed to run rake, tests, features, etc.
|
11
11
|
group :development do
|
12
12
|
gem 'jeweler', '~> 2.0'
|
13
|
-
gem 'rake-version', '~> 0
|
13
|
+
gem 'rake-version', '~> 1.0'
|
14
14
|
gem 'simplecov', '~> 0.10', require: false
|
15
15
|
gem 'fakefs', '~> 0.6', require: 'fakefs/safe'
|
16
16
|
gem 'rspec-its', '~> 1.2'
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
# Probe Dock
|
1
|
+
# RSpec Probe for Probe Dock
|
2
2
|
|
3
|
-
**RSpec
|
3
|
+
**RSpec formatter to publish test results to [Probe Dock](https://github.com/probedock/probedock).**
|
4
4
|
|
5
5
|
[](http://badge.fury.io/rb/probedock-rspec)
|
6
6
|
[](https://gemnasium.com/probedock/probedock-rspec)
|
@@ -8,43 +8,36 @@
|
|
8
8
|
[](https://coveralls.io/r/probedock/probedock-rspec?branch=master)
|
9
9
|
[](LICENSE.txt)
|
10
10
|
|
11
|
-
|
11
|
+
* [Requirements](#requirements)
|
12
|
+
* [Installation](#installation)
|
13
|
+
* [Usage](#usage)
|
14
|
+
* [Contributing](#contributing)
|
12
15
|
|
13
|
-
* RSpec 3+
|
14
16
|
|
15
|
-
## Installation
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
```rb
|
20
|
-
gem 'probedock-rspec', '~> 0.6.0'
|
21
|
-
```
|
18
|
+
<a name="requirements"></a>
|
19
|
+
## Requirements
|
22
20
|
|
23
|
-
|
21
|
+
* Ruby 2+
|
22
|
+
* RSpec 3+
|
24
23
|
|
25
|
-
gem install probedock-rspec
|
26
24
|
|
27
|
-
## Usage
|
28
25
|
|
29
|
-
|
26
|
+
<a name="installation"></a>
|
27
|
+
## Installation
|
30
28
|
|
31
|
-
|
29
|
+
Add it to your Gemfile:
|
32
30
|
|
33
31
|
```rb
|
34
|
-
|
35
|
-
expect(true).to be(true)
|
36
|
-
end
|
37
|
-
|
38
|
-
it(nil, probedock: { key: 'bcdefghijklm' }){ should validate_presence_of(:name) }
|
32
|
+
gem 'probedock-rspec', '~> 0.7.0'
|
39
33
|
```
|
40
34
|
|
41
|
-
|
42
|
-
## Setup
|
35
|
+
Then run `bundle install`.
|
43
36
|
|
44
|
-
|
37
|
+
If you haven't done so already, set up your Probe Dock configuration file(s).
|
45
38
|
This procedure is described here:
|
46
39
|
|
47
|
-
* [Probe Setup Procedure](https://github.com/probedock/probedock-
|
40
|
+
* [Probe Setup Procedure](https://github.com/probedock/probedock-probes#setup)
|
48
41
|
|
49
42
|
You must then enable the client in your spec helper file (e.g. `spec/spec_helper.rb`).
|
50
43
|
|
@@ -60,6 +53,31 @@ end
|
|
60
53
|
|
61
54
|
The next time you run your test suite, the RSpec probe will send the results to your Probe Dock server.
|
62
55
|
|
56
|
+
|
57
|
+
|
58
|
+
<a name="usage"></a>
|
59
|
+
## Usage
|
60
|
+
|
61
|
+
To track a test with a Probe Dock test key, use RSpec metadata:
|
62
|
+
|
63
|
+
```rb
|
64
|
+
it "should work", probedock: { key: 'abcd' } do
|
65
|
+
expect(true).to be(true)
|
66
|
+
end
|
67
|
+
|
68
|
+
it(nil, probedock: { key: 'bcde' }){ should validate_presence_of(:name) }
|
69
|
+
```
|
70
|
+
|
71
|
+
You may also define a category, tags and tickets for a test like this:
|
72
|
+
|
73
|
+
```rb
|
74
|
+
it "should work", probedock: { key: 'cdef', category: 'Integration', tags: %w(user-registration validation), tickets: %w(JIRA-1000 JIRA-1012) } do
|
75
|
+
expect(2).to be < 3
|
76
|
+
end
|
77
|
+
```
|
78
|
+
|
79
|
+
|
80
|
+
|
63
81
|
## Contributing
|
64
82
|
|
65
83
|
* [Fork](https://help.github.com/articles/fork-a-repo)
|
@@ -69,7 +87,8 @@ The next time you run your test suite, the RSpec probe will send the results to
|
|
69
87
|
|
70
88
|
Please add a [changelog](CHANGELOG.md) entry with your name for new features and bug fixes.
|
71
89
|
|
90
|
+
|
91
|
+
|
72
92
|
## License
|
73
93
|
|
74
|
-
|
75
|
-
See [LICENSE.txt](LICENSE.txt) for the full license.
|
94
|
+
**probedock-rspec** is licensed under the [MIT License](http://opensource.org/licenses/MIT).
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.7.0
|
@@ -1,9 +1,17 @@
|
|
1
1
|
module ProbeDockRSpec
|
2
|
+
def self.config
|
3
|
+
@config ||= ProbeDockProbe::Config.new
|
4
|
+
end
|
5
|
+
|
6
|
+
def self.config= config
|
7
|
+
@config = config
|
8
|
+
end
|
2
9
|
|
3
10
|
def self.configure options = {}, &block
|
4
|
-
ProbeDockProbe.config.load! &block
|
5
11
|
setup! if options.fetch :setup, true
|
6
|
-
|
12
|
+
config.load! &block
|
13
|
+
config.project.category ||= 'RSpec'
|
14
|
+
config
|
7
15
|
end
|
8
16
|
|
9
17
|
private
|
@@ -7,28 +7,33 @@ module ProbeDockRSpec
|
|
7
7
|
|
8
8
|
options = {}
|
9
9
|
|
10
|
-
%i(key category tags tickets data).each do |attr|
|
11
|
-
options[attr] = send
|
10
|
+
%i(key category tags tickets data active).each do |attr|
|
11
|
+
options[attr] = send("extract_#{attr}", example, groups)
|
12
12
|
end
|
13
13
|
|
14
|
-
name_parts = extract_name_parts
|
15
|
-
options[:name] = name_parts.join
|
16
|
-
options[:fingerprint] = Digest::SHA1.hexdigest
|
14
|
+
name_parts = extract_name_parts(example, groups)
|
15
|
+
options[:name] = name_parts.join(' ')
|
16
|
+
options[:fingerprint] = Digest::SHA1.hexdigest(name_parts.join('|||'))
|
17
|
+
|
18
|
+
data = options[:data]
|
19
|
+
metadata = example.metadata
|
17
20
|
|
18
21
|
# TODO: remove once Probe Dock has been migrated to use fingerprints
|
19
|
-
|
22
|
+
data['fingerprint'] = options[:fingerprint]
|
23
|
+
|
24
|
+
data['file.path'] = metadata[:file_path].to_s.sub(/^\.\//, '') if metadata[:file_path]
|
25
|
+
data['file.line'] = metadata[:line_number] if metadata[:line_number]
|
20
26
|
|
21
27
|
options
|
22
28
|
end
|
23
29
|
|
24
30
|
private
|
25
31
|
|
26
|
-
def self.extract_key
|
27
|
-
(groups.collect{ |g|
|
32
|
+
def self.extract_key(example, groups = [])
|
33
|
+
(groups.collect{ |g| probedock_meta(g)[:key] } << probedock_meta(example)[:key]).compact.reject{ |k| k.strip.empty? }.last
|
28
34
|
end
|
29
35
|
|
30
|
-
def self.
|
31
|
-
|
36
|
+
def self.probedock_meta(holder)
|
32
37
|
meta = holder.metadata[:probedock] || {}
|
33
38
|
|
34
39
|
if meta.kind_of? String
|
@@ -40,25 +45,29 @@ module ProbeDockRSpec
|
|
40
45
|
end
|
41
46
|
end
|
42
47
|
|
43
|
-
def self.extract_name_parts
|
48
|
+
def self.extract_name_parts(example, groups = [])
|
44
49
|
(groups.collect(&:description) << example.description).compact.collect(&:strip).reject{ |p| p.empty? }
|
45
50
|
end
|
46
51
|
|
47
|
-
def self.extract_category
|
48
|
-
cat = (groups.collect{ |g|
|
52
|
+
def self.extract_category(example, groups = [])
|
53
|
+
cat = (groups.collect{ |g| probedock_meta(g)[:category] } << probedock_meta(example)[:category]).compact.last
|
49
54
|
cat ? cat.to_s : nil
|
50
55
|
end
|
51
56
|
|
52
|
-
def self.
|
53
|
-
(groups.collect{ |g|
|
57
|
+
def self.extract_active(example, groups = [])
|
58
|
+
(groups.collect{ |g| probedock_meta(g)[:active] } << probedock_meta(example)[:active]).compact.last
|
59
|
+
end
|
60
|
+
|
61
|
+
def self.extract_tags(example, groups = [])
|
62
|
+
(groups.collect{ |g| wrap probedock_meta(g)[:tags] } + (wrap probedock_meta(example)[:tags])).flatten.compact.uniq.collect(&:to_s)
|
54
63
|
end
|
55
64
|
|
56
|
-
def self.extract_tickets
|
57
|
-
(groups.collect{ |g| wrap
|
65
|
+
def self.extract_tickets(example, groups = [])
|
66
|
+
(groups.collect{ |g| wrap probedock_meta(g)[:tickets] } + (wrap probedock_meta(example)[:tickets])).flatten.compact.uniq.collect(&:to_s)
|
58
67
|
end
|
59
68
|
|
60
|
-
def self.extract_data
|
61
|
-
|
69
|
+
def self.extract_data(example, groups = [])
|
70
|
+
probedock_meta(example)[:data] || {}
|
62
71
|
end
|
63
72
|
|
64
73
|
def self.wrap a
|
data/lib/probe_dock_rspec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: probedock-rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Oulevay (Alpha Hydrae)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 0.2.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 0.2.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: jeweler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0
|
61
|
+
version: '1.0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0
|
68
|
+
version: '1.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: simplecov
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -174,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
174
|
version: '0'
|
175
175
|
requirements: []
|
176
176
|
rubyforge_project:
|
177
|
-
rubygems_version: 2.4.
|
177
|
+
rubygems_version: 2.4.6
|
178
178
|
signing_key:
|
179
179
|
specification_version: 4
|
180
180
|
summary: RSpec client to publish test results to Probe Dock.
|