probedock-cucumber 0.1.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2286ed5e21fbf47725e16a0c43c6e9f977f6b8f6
4
+ data.tar.gz: 6a32e6aa3309aef8cda90a6b35c7131424827ce1
5
+ SHA512:
6
+ metadata.gz: 58cac119d835d2c90c3c12c71405662be7bfee895c01a0d24bb3589406872ce812b3c123c4d6b09ff933e3a345a93313052155c4dbe9103f8f77ad8229c6c7cb
7
+ data.tar.gz: c4b678b65c203690cd0cded6c85b507813225e83ab72887a556b6a85b0a4af9874076552ff623f08b1ef904bc7eb04ce26f0e5f217eb692fc8fea7fcf1de66fb
data/Gemfile ADDED
@@ -0,0 +1,19 @@
1
+ source "http://rubygems.org"
2
+ # Add dependencies required to use your gem here.
3
+ # Example:
4
+ # gem "activesupport", ">= 2.3.5"
5
+
6
+ gem 'probedock-ruby', '~> 0.1'
7
+
8
+ # Add dependencies to develop your gem here.
9
+ # Include everything needed to run rake, tests, features, etc.
10
+ group :development do
11
+ gem 'jeweler', '~> 2.0'
12
+ gem 'rake-version', '~> 0.4'
13
+ gem 'simplecov', '~> 0.10', require: false
14
+ gem 'fakefs', '~> 0.6', require: 'fakefs/safe'
15
+ gem 'rspec', '~> 3.1'
16
+ gem 'rspec-its', '~> 1.2'
17
+ gem 'rspec-collection_matchers', '~> 1.1'
18
+ gem 'coveralls', '~> 0.8', require: false
19
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2015 Probe Dock
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,32 @@
1
+ # Probe Dock Cucumber
2
+
3
+ **Cucumber (Ruby) probe for [Probe Dock](https://github.com/probedock/probedock).**
4
+
5
+ [![Gem Version](https://badge.fury.io/rb/probedock-cucumber.svg)](http://badge.fury.io/rb/probedock-cucumber)
6
+ [![Dependency Status](https://gemnasium.com/probedock/probedock-cucumber-ruby.svg)](https://gemnasium.com/probedock/probedock-cucumber-ruby)
7
+ [![Build Status](https://secure.travis-ci.org/probedock/probedock-cucumber-ruby.svg)](http://travis-ci.org/probedock/probedock-cucumber-ruby)
8
+ [![Coverage Status](https://coveralls.io/repos/probedock/probedock-cucumber-ruby/badge.svg)](https://coveralls.io/r/probedock/probedock-cucumber-ruby?branch=master)
9
+ [![License](https://img.shields.io/github/license/probedock/probedock-cucumber-ruby.svg)](LICENSE.txt)
10
+
11
+ ## Installation
12
+
13
+ In your Gemfile:
14
+
15
+ ```rb
16
+ gem 'probedock-cucumber', '~> 0.1.0'
17
+ ```
18
+
19
+ Then run `bundle install`.
20
+
21
+ ## Contributing
22
+
23
+ * [Fork](https://help.github.com/articles/fork-a-repo)
24
+ * Create a topic branch - `git checkout -b my_feature`
25
+ * Push to your branch - `git push origin my_feature`
26
+ * Create a [pull request](http://help.github.com/pull-requests/) from your branch
27
+
28
+ Please add a [changelog](CHANGELOG.md) entry with your name for new features and bug fixes.
29
+
30
+ ## License
31
+
32
+ Probe Dock Cucumber is licensed under the [MIT License](http://opensource.org/licenses/MIT).
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
@@ -0,0 +1,10 @@
1
+ # encoding: UTF-8
2
+ require 'probedock-ruby'
3
+
4
+ module ProbeDockCucumber
5
+ VERSION = '0.1.0'
6
+
7
+ class Error < StandardError; end
8
+ end
9
+
10
+ Dir[File.join File.dirname(__FILE__), File.basename(__FILE__, '.*'), '*.rb'].each{ |lib| require lib }
@@ -0,0 +1,6 @@
1
+ module ProbeDockCucumber
2
+ def self.configure options = {}, &block
3
+ ProbeDockProbe.config.load! &block
4
+ ProbeDockProbe.config
5
+ end
6
+ end
@@ -0,0 +1,102 @@
1
+ require 'paint'
2
+ require 'digest/sha1'
3
+
4
+ module ProbeDockCucumber
5
+ class Formatter
6
+
7
+ def initialize step_mother, io, options
8
+
9
+ config = ProbeDockProbe.config
10
+ @client = ProbeDockProbe::Client.new config.server, config.client_options
11
+ @test_run = ProbeDockProbe::TestRun.new config.project
12
+
13
+ @current_feature = nil
14
+ @current_feature_tags = []
15
+
16
+ @current_scenario = nil
17
+ @current_scenario_tags = []
18
+ @current_scenario_error = nil
19
+ end
20
+
21
+ def before_features *args
22
+ @start_time = Time.now
23
+ end
24
+
25
+ def before_feature feature, *args
26
+ @current_feature = feature.name.sub(/\n.*$/m, '').strip
27
+ @current_feature_tags = []
28
+ @current_scenario = nil
29
+ end
30
+
31
+ def after_tags tags, *args
32
+ if @current_scenario
33
+ @current_scenario_tags = tags.tags.collect{ |tag| tag.name.sub(/^@/, '').strip }.uniq
34
+ else
35
+ @current_feature_tags = tags.tags.collect{ |tag| tag.name.sub(/^@/, '').strip }.uniq
36
+ end
37
+ end
38
+
39
+ def before_feature_element feature_element, *args
40
+ @current_scenario = feature_element.name.sub(/\n.*$/m, '').strip
41
+ @current_scenario_tags = []
42
+ @current_scenario_error = nil
43
+ @current_scenario_start_time = Time.now
44
+ end
45
+
46
+ def after_step_result keyword, step_match, multiline_arg, status, exception, *args
47
+ if exception
48
+ @current_scenario_error = exception
49
+ end
50
+ end
51
+
52
+ def after_feature_element *args
53
+ add_result !@current_scenario_error, @current_scenario_error
54
+ end
55
+
56
+ def after_features *args
57
+ #puts "after_features: #{args.inspect}"
58
+ end_time = Time.now
59
+ @test_run.duration = ((end_time - @start_time) * 1000).round
60
+ puts @test_run.inspect
61
+ #@client.process @test_run
62
+ end
63
+
64
+ private
65
+
66
+ def add_result successful, error = nil
67
+
68
+ options = {
69
+ tags: (@current_feature_tags + @current_scenario_tags).uniq,
70
+ data: {}
71
+ }
72
+
73
+ name = @current_feature.dup
74
+ if name.match /\.$/
75
+ name << ' '
76
+ else
77
+ name << ': '
78
+ end
79
+
80
+ name << @current_scenario
81
+
82
+ options[:name] = name
83
+
84
+ fingerprint_data = [ @current_feature, @current_scenario ]
85
+ options[:fingerprint] = Digest::SHA1.hexdigest fingerprint_data.join('|||')
86
+ options[:data][:fingerprint] = options[:fingerprint]
87
+
88
+ options.merge! passed: successful, duration: ((Time.now - @current_scenario_start_time) * 1000).round
89
+ options[:message] = failure_message error if error
90
+
91
+ @test_run.add_result options
92
+ end
93
+
94
+ def failure_message error
95
+ String.new.tap do |m|
96
+ m << error.message
97
+ m << "\n"
98
+ m << error.backtrace.collect{ |l| " # #{l}" }.join("\n")
99
+ end
100
+ end
101
+ end
102
+ end
@@ -0,0 +1 @@
1
+ require 'probe_dock_cucumber'
metadata ADDED
@@ -0,0 +1,180 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: probedock-cucumber
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Simon Oulevay (Alpha Hydrae)
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-07-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: probedock-ruby
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: jeweler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake-version
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.4'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.4'
55
+ - !ruby/object:Gem::Dependency
56
+ name: simplecov
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.10'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.10'
69
+ - !ruby/object:Gem::Dependency
70
+ name: fakefs
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.6'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.6'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.1'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.1'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rspec-its
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '1.2'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '1.2'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rspec-collection_matchers
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '1.1'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '1.1'
125
+ - !ruby/object:Gem::Dependency
126
+ name: coveralls
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '0.8'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '0.8'
139
+ description: Cucumber client to publish test results to Probe Dock, a test tracking
140
+ and analysis server.
141
+ email: devops@probedock.io
142
+ executables: []
143
+ extensions: []
144
+ extra_rdoc_files:
145
+ - LICENSE.txt
146
+ - README.md
147
+ files:
148
+ - Gemfile
149
+ - LICENSE.txt
150
+ - README.md
151
+ - VERSION
152
+ - lib/probe_dock_cucumber.rb
153
+ - lib/probe_dock_cucumber/config.rb
154
+ - lib/probe_dock_cucumber/formatter.rb
155
+ - lib/probedock-cucumber.rb
156
+ homepage: https://github.com/probedock/probedock-cucumber-ruby
157
+ licenses:
158
+ - MIT
159
+ metadata: {}
160
+ post_install_message:
161
+ rdoc_options: []
162
+ require_paths:
163
+ - lib
164
+ required_ruby_version: !ruby/object:Gem::Requirement
165
+ requirements:
166
+ - - ">="
167
+ - !ruby/object:Gem::Version
168
+ version: '0'
169
+ required_rubygems_version: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ requirements: []
175
+ rubyforge_project:
176
+ rubygems_version: 2.4.8
177
+ signing_key:
178
+ specification_version: 4
179
+ summary: Cucumber client to publish test results to Probe Dock.
180
+ test_files: []