cucumber-messages 1.0.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
+ SHA256:
3
+ metadata.gz: 044b9422f8add17b93b133695227dcbdbe4076302237d4f0c8899f7d04b5d9e3
4
+ data.tar.gz: 849b9bc2ab915d84403548dd127bfed5d9c424f08a6e947b948412d4ad19bf7e
5
+ SHA512:
6
+ metadata.gz: a90107ed2606654fbf979008588002686145f0b6474a123360b9c534057433be7696acfc156e8e64d8edf0f2f4926cc235d0b25ed2e4c1c1f27266e4f6a59fdc
7
+ data.tar.gz: 5fd6971db10cf0bf7abbc4e93d9a8ce878dbac47bca8b42cf70b3cb0221e96c5ff80e3063a261c050f987c3d1e2c84d5fd3a4270f03eb24506a763ccc10f6d49
@@ -0,0 +1,5 @@
1
+ PLEASE DO NOT CREATE ISSUES IN THIS REPO.
2
+ THIS REPO IS A READ-ONLY MIRROR.
3
+
4
+ Create your issue in the Cucumber monorepo instead:
5
+ https://github.com/cucumber/cucumber/issues
@@ -0,0 +1,5 @@
1
+ PLEASE DO NOT CREATE PULL REAUESTS IN THIS REPO.
2
+ THIS REPO IS A READ-ONLY MIRROR.
3
+
4
+ Create your pull request in the Cucumber monorepo instead:
5
+ https://github.com/cucumber/cucumber/pulls
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
data/.rsync ADDED
@@ -0,0 +1,4 @@
1
+ ../../LICENSE LICENSE
2
+ ../../.templates/github/ .github/
3
+ ../../.templates/ruby/ .
4
+ ../messages.proto messages.proto
data/.subrepo ADDED
@@ -0,0 +1 @@
1
+ cucumber/cucumber-messages-ruby
data/.travis.yml ADDED
@@ -0,0 +1,15 @@
1
+ sudo: false
2
+ language: ruby
3
+
4
+ rvm:
5
+ - "2.5.1"
6
+ - "2.4.4"
7
+ - "2.3.7"
8
+ - "2.2.10"
9
+ - "jruby-9.1.17.0"
10
+
11
+ script: make default
12
+
13
+ matrix:
14
+ allow_failures:
15
+ - rvm: "jruby-9.1.17.0"
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+ source "https://rubygems.org"
3
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) Cucumber Ltd
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/Makefile ADDED
@@ -0,0 +1,9 @@
1
+ include default.mk
2
+
3
+ .deps: lib/cucumber/messages_pb.rb
4
+
5
+ lib/cucumber/messages_pb.rb: messages.proto
6
+ protoc --ruby_out lib/cucumber $<
7
+
8
+ clean:
9
+ rm -f lib/cucumber/messages_pb.rb
data/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # Cucumber Messages for Ruby (Protocol Buffers)
2
+
3
+ [![Build Status](https://travis-ci.org/cucumber/cucumber-messages-ruby.svg?branch=master)](https://travis-ci.org/cucumber/cucumber-messages-ruby)
data/Rakefile ADDED
@@ -0,0 +1,23 @@
1
+ # encoding: utf-8
2
+ require 'rubygems'
3
+ require 'bundler'
4
+ Bundler::GemHelper.install_tasks
5
+
6
+ $:.unshift File.expand_path("../lib", __FILE__)
7
+
8
+ require "rspec/core/rake_task"
9
+ RSpec::Core::RakeTask.new(:spec) do |t|
10
+ t.ruby_opts = %w[-r./spec/coverage -w]
11
+ end
12
+
13
+ require_relative 'spec/capture_warnings'
14
+ include CaptureWarnings
15
+ namespace :spec do
16
+ task :warnings do
17
+ report_warnings do
18
+ Rake::Task['spec'].invoke
19
+ end
20
+ end
21
+ end
22
+
23
+ task default: ['spec:warnings']
@@ -0,0 +1,34 @@
1
+ # -*- encoding: utf-8 -*-
2
+ Gem::Specification.new do |s|
3
+ s.name = 'cucumber-messages'
4
+ s.version = '1.0.0'
5
+ s.authors = ["Aslak Hellesøy"]
6
+ s.description = "Protocol Buffer messages for Cucumber's inter-process communication"
7
+ s.summary = "cucumber-messages-#{s.version}"
8
+ s.email = 'cukes@googlegroups.com'
9
+ s.homepage = "https://github.com/cucumber/cucumber-messages-ruby#readme"
10
+ s.platform = Gem::Platform::RUBY
11
+ s.license = "MIT"
12
+ s.required_ruby_version = ">= 1.9.3"
13
+
14
+ # As of this writing (28 June 2018), the latest version is
15
+ # 3.6.0, which doesn't works with JRuby.
16
+ # See https://github.com/google/protobuf/issues/1594
17
+ # 3.1.0 works with JRuby, but fails with MRI 2.4.4 and above.
18
+ # There doesn't seem to be a version that works with all rubies,
19
+ # so we're picking the version that works with the most recent MRIs.
20
+ s.add_dependency 'google-protobuf', '3.6.1'
21
+
22
+ s.add_development_dependency 'bundler'
23
+ s.add_development_dependency 'rake', '~> 12.3'
24
+ s.add_development_dependency 'rspec', '~> 3.7'
25
+
26
+ # For coverage reports
27
+ s.add_development_dependency 'coveralls'
28
+
29
+ s.rubygems_version = ">= 1.6.1"
30
+ s.files = `git ls-files`.split("\n").reject {|path| path =~ /\.gitignore$/ }
31
+ s.test_files = `git ls-files -- spec/*`.split("\n")
32
+ s.rdoc_options = ["--charset=UTF-8"]
33
+ s.require_path = "lib"
34
+ end
data/default.mk ADDED
@@ -0,0 +1,33 @@
1
+ SHELL := /usr/bin/env bash
2
+ RUBY_SOURCE_FILES = $(shell find . -name "*.rb")
3
+ GEMSPECS = $(shell find . -name "*.gemspec")
4
+
5
+ ifdef TRAVIS_BRANCH
6
+ LIBRARY_VERSION=$(TRAVIS_BRANCH)
7
+ endif
8
+ ifdef TRAVIS_TAG
9
+ LIBRARY_VERSION=$(TRAVIS_TAG)
10
+ endif
11
+ ifndef LIBRARY_VERSION
12
+ LIBRARY_VERSION=$(shell git rev-parse --abbrev-ref HEAD)
13
+ endif
14
+
15
+ default: .tested
16
+ .PHONY: default
17
+
18
+ .deps: Gemfile.lock
19
+
20
+ Gemfile.lock: Gemfile $(GEMSPECS)
21
+ bundle install
22
+ touch $@
23
+
24
+ .tested: .deps $(RUBY_SOURCE_FILES)
25
+ bundle exec rspec --color
26
+ touch $@
27
+
28
+ clean: clean-ruby
29
+ .PHONY: clean
30
+
31
+ clean-ruby:
32
+ rm -f .deps .linked .tested Gemfile.lock
33
+ .PHONY: clean-ruby
@@ -0,0 +1,36 @@
1
+ require 'cucumber/messages_pb'
2
+
3
+ module Cucumber
4
+ module Messages
5
+ module Varint
6
+ def decode_varint(io)
7
+ # https://github.com/ruby-protobuf/protobuf/blob/master/lib/protobuf/varint_pure.rb
8
+ value = index = 0
9
+ begin
10
+ byte = io.readbyte
11
+ value |= (byte & 0x7f) << (7 * index)
12
+ index += 1
13
+ end while (byte & 0x80).nonzero?
14
+ value
15
+ end
16
+
17
+ # https://www.rubydoc.info/gems/ruby-protocol-buffers/1.2.2/ProtocolBuffers%2FVarint.encode
18
+ def encode_varint(io, int_val)
19
+ if int_val < 0
20
+ # negative varints are always encoded with the full 10 bytes
21
+ int_val = int_val & 0xffffffff_ffffffff
22
+ end
23
+ loop do
24
+ byte = int_val & 0x7f
25
+ int_val >>= 7
26
+ if int_val == 0
27
+ io << byte.chr
28
+ break
29
+ else
30
+ io << (byte | 0x80).chr
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,242 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: messages.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/protobuf/timestamp_pb'
7
+ Google::Protobuf::DescriptorPool.generated_pool.build do
8
+ add_message "io.cucumber.messages.Wrapper" do
9
+ oneof :message do
10
+ optional :source, :message, 1, "io.cucumber.messages.Source"
11
+ optional :gherkinDocument, :message, 2, "io.cucumber.messages.GherkinDocument"
12
+ optional :pickle, :message, 3, "io.cucumber.messages.Pickle"
13
+ optional :attachment, :message, 4, "io.cucumber.messages.Attachment"
14
+ optional :testCaseStarted, :message, 5, "io.cucumber.messages.TestCaseStarted"
15
+ optional :testStepStarted, :message, 6, "io.cucumber.messages.TestStepStarted"
16
+ optional :testStepFinished, :message, 7, "io.cucumber.messages.TestStepFinished"
17
+ optional :testCaseFinished, :message, 8, "io.cucumber.messages.TestCaseFinished"
18
+ end
19
+ end
20
+ add_message "io.cucumber.messages.SourceReference" do
21
+ optional :uri, :string, 1
22
+ optional :location, :message, 2, "io.cucumber.messages.Location"
23
+ end
24
+ add_message "io.cucumber.messages.Location" do
25
+ optional :line, :uint32, 1
26
+ optional :column, :uint32, 2
27
+ end
28
+ add_message "io.cucumber.messages.Attachment" do
29
+ optional :source, :message, 1, "io.cucumber.messages.SourceReference"
30
+ optional :data, :string, 2
31
+ optional :media, :message, 3, "io.cucumber.messages.Media"
32
+ end
33
+ add_message "io.cucumber.messages.Media" do
34
+ optional :encoding, :string, 1
35
+ optional :content_type, :string, 2
36
+ end
37
+ add_message "io.cucumber.messages.Source" do
38
+ optional :uri, :string, 1
39
+ optional :data, :string, 2
40
+ optional :media, :message, 3, "io.cucumber.messages.Media"
41
+ end
42
+ add_message "io.cucumber.messages.GherkinDocument" do
43
+ optional :uri, :string, 1
44
+ optional :feature, :message, 2, "io.cucumber.messages.Feature"
45
+ repeated :comments, :message, 3, "io.cucumber.messages.Comment"
46
+ end
47
+ add_message "io.cucumber.messages.Feature" do
48
+ optional :location, :message, 1, "io.cucumber.messages.Location"
49
+ repeated :tags, :message, 2, "io.cucumber.messages.Tag"
50
+ optional :language, :string, 3
51
+ optional :keyword, :string, 4
52
+ optional :name, :string, 5
53
+ optional :description, :string, 6
54
+ repeated :children, :message, 7, "io.cucumber.messages.FeatureChild"
55
+ end
56
+ add_message "io.cucumber.messages.FeatureChild" do
57
+ oneof :value do
58
+ optional :rule, :message, 1, "io.cucumber.messages.Rule"
59
+ optional :background, :message, 2, "io.cucumber.messages.Background"
60
+ optional :scenario, :message, 3, "io.cucumber.messages.Scenario"
61
+ end
62
+ end
63
+ add_message "io.cucumber.messages.Rule" do
64
+ optional :location, :message, 1, "io.cucumber.messages.Location"
65
+ optional :keyword, :string, 2
66
+ optional :name, :string, 3
67
+ optional :description, :string, 4
68
+ repeated :children, :message, 5, "io.cucumber.messages.RuleChild"
69
+ end
70
+ add_message "io.cucumber.messages.RuleChild" do
71
+ oneof :value do
72
+ optional :background, :message, 1, "io.cucumber.messages.Background"
73
+ optional :scenario, :message, 2, "io.cucumber.messages.Scenario"
74
+ end
75
+ end
76
+ add_message "io.cucumber.messages.Background" do
77
+ optional :location, :message, 1, "io.cucumber.messages.Location"
78
+ optional :keyword, :string, 2
79
+ optional :name, :string, 3
80
+ optional :description, :string, 4
81
+ repeated :steps, :message, 5, "io.cucumber.messages.Step"
82
+ end
83
+ add_message "io.cucumber.messages.Scenario" do
84
+ optional :location, :message, 1, "io.cucumber.messages.Location"
85
+ repeated :tags, :message, 2, "io.cucumber.messages.Tag"
86
+ optional :keyword, :string, 3
87
+ optional :name, :string, 4
88
+ optional :description, :string, 5
89
+ repeated :steps, :message, 6, "io.cucumber.messages.Step"
90
+ repeated :examples, :message, 7, "io.cucumber.messages.Examples"
91
+ end
92
+ add_message "io.cucumber.messages.Comment" do
93
+ optional :location, :message, 1, "io.cucumber.messages.Location"
94
+ optional :text, :string, 2
95
+ end
96
+ add_message "io.cucumber.messages.DataTable" do
97
+ optional :location, :message, 1, "io.cucumber.messages.Location"
98
+ repeated :rows, :message, 2, "io.cucumber.messages.TableRow"
99
+ end
100
+ add_message "io.cucumber.messages.DocString" do
101
+ optional :location, :message, 1, "io.cucumber.messages.Location"
102
+ optional :content_type, :string, 2
103
+ optional :content, :string, 3
104
+ optional :delimiter, :string, 4
105
+ end
106
+ add_message "io.cucumber.messages.Examples" do
107
+ optional :location, :message, 1, "io.cucumber.messages.Location"
108
+ repeated :tags, :message, 2, "io.cucumber.messages.Tag"
109
+ optional :keyword, :string, 3
110
+ optional :name, :string, 4
111
+ optional :description, :string, 5
112
+ optional :table_header, :message, 6, "io.cucumber.messages.TableRow"
113
+ repeated :table_body, :message, 7, "io.cucumber.messages.TableRow"
114
+ end
115
+ add_message "io.cucumber.messages.Step" do
116
+ optional :location, :message, 1, "io.cucumber.messages.Location"
117
+ optional :keyword, :string, 2
118
+ optional :text, :string, 3
119
+ oneof :argument do
120
+ optional :doc_string, :message, 5, "io.cucumber.messages.DocString"
121
+ optional :data_table, :message, 6, "io.cucumber.messages.DataTable"
122
+ end
123
+ end
124
+ add_message "io.cucumber.messages.TableCell" do
125
+ optional :location, :message, 1, "io.cucumber.messages.Location"
126
+ optional :value, :string, 2
127
+ end
128
+ add_message "io.cucumber.messages.TableRow" do
129
+ optional :location, :message, 1, "io.cucumber.messages.Location"
130
+ repeated :cells, :message, 2, "io.cucumber.messages.TableCell"
131
+ end
132
+ add_message "io.cucumber.messages.Tag" do
133
+ optional :location, :message, 1, "io.cucumber.messages.Location"
134
+ optional :name, :string, 2
135
+ end
136
+ add_message "io.cucumber.messages.Pickle" do
137
+ optional :id, :string, 1
138
+ optional :uri, :string, 2
139
+ optional :name, :string, 3
140
+ optional :language, :string, 4
141
+ repeated :steps, :message, 5, "io.cucumber.messages.PickleStep"
142
+ repeated :tags, :message, 6, "io.cucumber.messages.PickleTag"
143
+ repeated :locations, :message, 7, "io.cucumber.messages.Location"
144
+ end
145
+ add_message "io.cucumber.messages.PickleStep" do
146
+ optional :text, :string, 1
147
+ repeated :locations, :message, 2, "io.cucumber.messages.Location"
148
+ oneof :argument do
149
+ optional :doc_string, :message, 3, "io.cucumber.messages.PickleDocString"
150
+ optional :data_table, :message, 4, "io.cucumber.messages.PickleTable"
151
+ end
152
+ end
153
+ add_message "io.cucumber.messages.PickleDocString" do
154
+ optional :location, :message, 1, "io.cucumber.messages.Location"
155
+ optional :contentType, :string, 2
156
+ optional :content, :string, 3
157
+ end
158
+ add_message "io.cucumber.messages.PickleTable" do
159
+ repeated :rows, :message, 1, "io.cucumber.messages.PickleTableRow"
160
+ end
161
+ add_message "io.cucumber.messages.PickleTableCell" do
162
+ optional :location, :message, 1, "io.cucumber.messages.Location"
163
+ optional :value, :string, 2
164
+ end
165
+ add_message "io.cucumber.messages.PickleTableRow" do
166
+ repeated :cells, :message, 1, "io.cucumber.messages.PickleTableCell"
167
+ end
168
+ add_message "io.cucumber.messages.PickleTag" do
169
+ optional :location, :message, 1, "io.cucumber.messages.Location"
170
+ optional :name, :string, 2
171
+ end
172
+ add_message "io.cucumber.messages.TestCaseStarted" do
173
+ optional :pickleId, :string, 1
174
+ optional :timestamp, :message, 2, "google.protobuf.Timestamp"
175
+ end
176
+ add_message "io.cucumber.messages.TestCaseFinished" do
177
+ optional :pickleId, :string, 1
178
+ optional :timestamp, :message, 2, "google.protobuf.Timestamp"
179
+ end
180
+ add_message "io.cucumber.messages.TestStepStarted" do
181
+ optional :pickleId, :string, 1
182
+ optional :index, :uint32, 2
183
+ optional :timestamp, :message, 3, "google.protobuf.Timestamp"
184
+ end
185
+ add_message "io.cucumber.messages.TestStepFinished" do
186
+ optional :pickleId, :string, 1
187
+ optional :index, :uint32, 2
188
+ optional :testResult, :message, 3, "io.cucumber.messages.TestResult"
189
+ optional :timestamp, :message, 4, "google.protobuf.Timestamp"
190
+ end
191
+ add_message "io.cucumber.messages.TestResult" do
192
+ optional :status, :enum, 1, "io.cucumber.messages.Status"
193
+ optional :message, :string, 2
194
+ end
195
+ add_enum "io.cucumber.messages.Status" do
196
+ value :AMBIGUOUS, 0
197
+ value :FAILED, 1
198
+ value :PASSED, 2
199
+ value :PENDING, 3
200
+ value :SKIPPED, 4
201
+ value :UNDEFINED, 5
202
+ end
203
+ end
204
+
205
+ module Cucumber
206
+ module Messages
207
+ Wrapper = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.Wrapper").msgclass
208
+ SourceReference = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.SourceReference").msgclass
209
+ Location = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.Location").msgclass
210
+ Attachment = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.Attachment").msgclass
211
+ Media = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.Media").msgclass
212
+ Source = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.Source").msgclass
213
+ GherkinDocument = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.GherkinDocument").msgclass
214
+ Feature = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.Feature").msgclass
215
+ FeatureChild = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.FeatureChild").msgclass
216
+ Rule = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.Rule").msgclass
217
+ RuleChild = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.RuleChild").msgclass
218
+ Background = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.Background").msgclass
219
+ Scenario = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.Scenario").msgclass
220
+ Comment = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.Comment").msgclass
221
+ DataTable = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.DataTable").msgclass
222
+ DocString = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.DocString").msgclass
223
+ Examples = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.Examples").msgclass
224
+ Step = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.Step").msgclass
225
+ TableCell = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.TableCell").msgclass
226
+ TableRow = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.TableRow").msgclass
227
+ Tag = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.Tag").msgclass
228
+ Pickle = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.Pickle").msgclass
229
+ PickleStep = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.PickleStep").msgclass
230
+ PickleDocString = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.PickleDocString").msgclass
231
+ PickleTable = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.PickleTable").msgclass
232
+ PickleTableCell = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.PickleTableCell").msgclass
233
+ PickleTableRow = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.PickleTableRow").msgclass
234
+ PickleTag = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.PickleTag").msgclass
235
+ TestCaseStarted = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.TestCaseStarted").msgclass
236
+ TestCaseFinished = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.TestCaseFinished").msgclass
237
+ TestStepStarted = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.TestStepStarted").msgclass
238
+ TestStepFinished = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.TestStepFinished").msgclass
239
+ TestResult = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.TestResult").msgclass
240
+ Status = Google::Protobuf::DescriptorPool.generated_pool.lookup("io.cucumber.messages.Status").enummodule
241
+ end
242
+ end
data/messages.proto ADDED
@@ -0,0 +1,243 @@
1
+ syntax = "proto3";
2
+ import "google/protobuf/timestamp.proto";
3
+ package io.cucumber.messages;
4
+ option ruby_package = "Cucumber.Messages";
5
+ option go_package = "messages";
6
+
7
+ // All messages sent between processes must be of type Wrapper
8
+ message Wrapper {
9
+ oneof message {
10
+ Source source = 1;
11
+ GherkinDocument gherkinDocument = 2;
12
+ Pickle pickle = 3;
13
+ Attachment attachment = 4;
14
+ TestCaseStarted testCaseStarted = 5;
15
+ TestStepStarted testStepStarted = 6;
16
+ TestStepFinished testStepFinished = 7;
17
+ TestCaseFinished testCaseFinished = 8;
18
+ }
19
+ }
20
+
21
+ ////// Source
22
+
23
+ message SourceReference {
24
+ string uri = 1;
25
+ Location location = 2;
26
+ }
27
+
28
+ message Location {
29
+ uint32 line = 1;
30
+ uint32 column = 2;
31
+ }
32
+
33
+ message Attachment {
34
+ SourceReference source = 1;
35
+ string data = 2;
36
+ Media media = 3;
37
+ }
38
+
39
+ message Media {
40
+ string encoding = 1;
41
+ string content_type = 2;
42
+ }
43
+
44
+ message Source {
45
+ string uri = 1;
46
+ string data = 2;
47
+ Media media = 3;
48
+ }
49
+
50
+ ////// Gherkin
51
+
52
+ message GherkinDocument {
53
+ string uri = 1;
54
+ Feature feature = 2;
55
+ repeated Comment comments = 3;
56
+ }
57
+
58
+ message Feature {
59
+ Location location = 1;
60
+ repeated Tag tags = 2;
61
+ string language = 3;
62
+ string keyword = 4;
63
+ string name = 5;
64
+ string description = 6;
65
+ repeated FeatureChild children = 7;
66
+ }
67
+
68
+ message FeatureChild {
69
+ oneof value {
70
+ Rule rule = 1;
71
+ Background background = 2;
72
+ Scenario scenario = 3;
73
+ }
74
+ }
75
+
76
+ message Rule {
77
+ Location location = 1;
78
+ string keyword = 2;
79
+ string name = 3;
80
+ string description = 4;
81
+ repeated RuleChild children = 5;
82
+ }
83
+
84
+ message RuleChild {
85
+ oneof value {
86
+ Background background = 1;
87
+ Scenario scenario = 2;
88
+ }
89
+ }
90
+
91
+ message Background {
92
+ Location location = 1;
93
+ string keyword = 2;
94
+ string name = 3;
95
+ string description = 4;
96
+ repeated Step steps = 5;
97
+ }
98
+
99
+ message Scenario {
100
+ Location location = 1;
101
+ repeated Tag tags = 2;
102
+ string keyword = 3;
103
+ string name = 4;
104
+ string description = 5;
105
+ repeated Step steps = 6;
106
+ repeated Examples examples = 7;
107
+ }
108
+
109
+ message Comment {
110
+ Location location = 1;
111
+ string text = 2;
112
+ }
113
+
114
+ message DataTable {
115
+ Location location = 1;
116
+ repeated TableRow rows = 2;
117
+ }
118
+
119
+ message DocString {
120
+ Location location = 1;
121
+ string content_type = 2;
122
+ string content = 3;
123
+ string delimiter = 4;
124
+ }
125
+
126
+ message Examples {
127
+ Location location = 1;
128
+ repeated Tag tags = 2;
129
+ string keyword = 3;
130
+ string name = 4;
131
+ string description = 5;
132
+ TableRow table_header = 6;
133
+ repeated TableRow table_body = 7;
134
+ }
135
+
136
+ message Step {
137
+ Location location = 1;
138
+ string keyword = 2;
139
+ string text = 3;
140
+ oneof argument {
141
+ DocString doc_string = 5;
142
+ DataTable data_table = 6;
143
+ }
144
+ }
145
+
146
+ message TableCell {
147
+ Location location = 1;
148
+ string value = 2;
149
+ }
150
+
151
+ message TableRow {
152
+ Location location = 1;
153
+ repeated TableCell cells = 2;
154
+ }
155
+
156
+ message Tag {
157
+ Location location = 1;
158
+ string name = 2;
159
+ }
160
+
161
+ ////// Pickles
162
+
163
+ message Pickle {
164
+ string id = 1;
165
+ string uri = 2;
166
+ string name = 3;
167
+ string language = 4;
168
+ repeated PickleStep steps = 5;
169
+ repeated PickleTag tags = 6;
170
+ repeated Location locations = 7;
171
+ }
172
+
173
+ message PickleStep {
174
+ string text = 1;
175
+ repeated Location locations = 2;
176
+ oneof argument {
177
+ PickleDocString doc_string = 3;
178
+ PickleTable data_table = 4;
179
+ }
180
+ }
181
+
182
+ message PickleDocString {
183
+ Location location = 1;
184
+ string contentType = 2;
185
+ string content = 3;
186
+ }
187
+
188
+ message PickleTable {
189
+ repeated PickleTableRow rows = 1;
190
+ }
191
+
192
+ message PickleTableCell {
193
+ Location location = 1;
194
+ string value = 2;
195
+ }
196
+
197
+ message PickleTableRow {
198
+ repeated PickleTableCell cells = 1;
199
+ }
200
+
201
+ message PickleTag {
202
+ Location location = 1;
203
+ string name = 2;
204
+ }
205
+
206
+ ////// Results
207
+
208
+ message TestCaseStarted {
209
+ string pickleId = 1;
210
+ google.protobuf.Timestamp timestamp = 2;
211
+ }
212
+
213
+ message TestCaseFinished {
214
+ string pickleId = 1;
215
+ google.protobuf.Timestamp timestamp = 2;
216
+ }
217
+
218
+ message TestStepStarted {
219
+ string pickleId = 1;
220
+ uint32 index = 2;
221
+ google.protobuf.Timestamp timestamp = 3;
222
+ }
223
+
224
+ message TestStepFinished {
225
+ string pickleId = 1;
226
+ uint32 index = 2;
227
+ TestResult testResult = 3;
228
+ google.protobuf.Timestamp timestamp = 4;
229
+ }
230
+
231
+ message TestResult {
232
+ Status status = 1;
233
+ string message = 2;
234
+ }
235
+
236
+ enum Status {
237
+ AMBIGUOUS = 0;
238
+ FAILED = 1;
239
+ PASSED = 2;
240
+ PENDING = 3;
241
+ SKIPPED = 4;
242
+ UNDEFINED = 5;
243
+ }
@@ -0,0 +1,74 @@
1
+ # frozen_string_literal: true
2
+ # With thanks to @myronmarston
3
+ # https://github.com/vcr/vcr/blob/master/spec/capture_warnings.rb
4
+
5
+ module CaptureWarnings
6
+ def report_warnings(&block)
7
+ current_dir = Dir.pwd
8
+ warnings, errors = capture_error(&block).partition { |line| line.include?('warning') }
9
+ project_warnings, other_warnings = warnings.uniq.partition { |line| line.include?(current_dir) }
10
+
11
+ if errors.any?
12
+ puts errors.join("\n")
13
+ end
14
+
15
+ if other_warnings.any?
16
+ puts "#{ other_warnings.count } warnings detected, set VIEW_OTHER_WARNINGS=true to see them."
17
+ print_warnings('other', other_warnings) if ENV['VIEW_OTHER_WARNINGS']
18
+ end
19
+
20
+ # Until they fix https://bugs.ruby-lang.org/issues/10661
21
+ if RUBY_VERSION == "2.2.0"
22
+ project_warnings = project_warnings.reject { |w| w =~ /warning: possible reference to past scope/ }
23
+ end
24
+
25
+ if project_warnings.any?
26
+ puts "#{ project_warnings.count } warnings detected"
27
+ print_warnings('cucumber-expressions', project_warnings)
28
+ fail "Please remove all cucumber-expressions warnings."
29
+ end
30
+
31
+ ensure_system_exit_if_required
32
+ end
33
+
34
+ def capture_error(&block)
35
+ old_stderr = STDERR.clone
36
+ pipe_r, pipe_w = IO.pipe
37
+ pipe_r.sync = true
38
+ error = String.new
39
+ reader = Thread.new do
40
+ begin
41
+ loop do
42
+ error << pipe_r.readpartial(1024)
43
+ end
44
+ rescue EOFError
45
+ end
46
+ end
47
+ STDERR.reopen(pipe_w)
48
+ block.call
49
+ ensure
50
+ capture_system_exit
51
+ STDERR.reopen(old_stderr)
52
+ pipe_w.close
53
+ reader.join
54
+ return error.split("\n")
55
+ end
56
+
57
+ def print_warnings(type, warnings)
58
+ puts
59
+ puts "-" * 30 + " #{type} warnings: " + "-" * 30
60
+ puts
61
+ puts warnings.join("\n")
62
+ puts
63
+ puts "-" * 75
64
+ puts
65
+ end
66
+
67
+ def ensure_system_exit_if_required
68
+ raise @system_exit if @system_exit
69
+ end
70
+
71
+ def capture_system_exit
72
+ @system_exit = $!
73
+ end
74
+ end
data/spec/coverage.rb ADDED
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+ require 'simplecov'
3
+ formatters = [ SimpleCov::Formatter::HTMLFormatter ]
4
+
5
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(*formatters)
6
+ SimpleCov.add_filter 'spec/'
7
+ SimpleCov.start
@@ -0,0 +1,23 @@
1
+ require 'cucumber/messages_pb'
2
+ require 'json'
3
+
4
+ module Cucumber
5
+ module Messages
6
+ describe Messages do
7
+ it "builds a pickle doc string" do
8
+ location = Location.new(line: 10, column: 20)
9
+ pickle_doc_tring = PickleDocString.new(
10
+ location: location,
11
+ contentType: 'text/plain',
12
+ content: 'some\ncontent\n'
13
+ )
14
+ expect(JSON.parse(PickleDocString.encode_json(pickle_doc_tring)))
15
+ .to(eq(
16
+ 'location' => { 'line' => 10, 'column' => 20 },
17
+ 'contentType' => 'text/plain',
18
+ 'content' => 'some\ncontent\n'
19
+ ))
20
+ end
21
+ end
22
+ end
23
+ end
metadata ADDED
@@ -0,0 +1,136 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cucumber-messages
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Aslak Hellesøy
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-09-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: google-protobuf
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 3.6.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 3.6.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '12.3'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '12.3'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.7'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.7'
69
+ - !ruby/object:Gem::Dependency
70
+ name: coveralls
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description: Protocol Buffer messages for Cucumber's inter-process communication
84
+ email: cukes@googlegroups.com
85
+ executables: []
86
+ extensions: []
87
+ extra_rdoc_files: []
88
+ files:
89
+ - ".github/ISSUE_TEMPLATE.md"
90
+ - ".github/PULL_REQUEST_TEMPLATE.md"
91
+ - ".rspec"
92
+ - ".rsync"
93
+ - ".subrepo"
94
+ - ".travis.yml"
95
+ - Gemfile
96
+ - LICENSE
97
+ - Makefile
98
+ - README.md
99
+ - Rakefile
100
+ - cucumber-messages.gemspec
101
+ - default.mk
102
+ - lib/cucumber/messages.rb
103
+ - lib/cucumber/messages_pb.rb
104
+ - messages.proto
105
+ - spec/capture_warnings.rb
106
+ - spec/coverage.rb
107
+ - spec/cucumber/messages/messages_spec.rb
108
+ homepage: https://github.com/cucumber/cucumber-messages-ruby#readme
109
+ licenses:
110
+ - MIT
111
+ metadata: {}
112
+ post_install_message:
113
+ rdoc_options:
114
+ - "--charset=UTF-8"
115
+ require_paths:
116
+ - lib
117
+ required_ruby_version: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - ">="
120
+ - !ruby/object:Gem::Version
121
+ version: 1.9.3
122
+ required_rubygems_version: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - ">="
125
+ - !ruby/object:Gem::Version
126
+ version: '0'
127
+ requirements: []
128
+ rubyforge_project:
129
+ rubygems_version: 2.7.6
130
+ signing_key:
131
+ specification_version: 4
132
+ summary: cucumber-messages-1.0.0
133
+ test_files:
134
+ - spec/capture_warnings.rb
135
+ - spec/coverage.rb
136
+ - spec/cucumber/messages/messages_spec.rb