cucumber-messages 13.0.0 → 14.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 713a658f8965cf01a13cf0a47b18305449c7ce32416b3919657375b524641031
4
- data.tar.gz: 55768b934bdbd23530761c89b9d050df9ee9d94b591436984ce9db1d1888f152
3
+ metadata.gz: 209607333877ccdedc0b706c2b9e8ed04ae481bb0d69e0f97d9f2e8393a13f0a
4
+ data.tar.gz: ec4bfb28fca377b77d04112dcd2bcb8b25c0fcf3af46f77719240c046dd535e8
5
5
  SHA512:
6
- metadata.gz: 0bee6fef69261e393e949d1e4604a2a5cf75425256b2807c14577c8f35dfcedf7d05c74a114a83c15402af8591cc38bdbbeb0d75f1fd2ae8c4b7800f38af1c45
7
- data.tar.gz: 5ccb7800a8cffbfb9d540cdb4f4f318140c76fc6fb2ebfadda6ada4bb2854100c3cfdd5158a17efd4859cee13e229d7607f973608b8de5309326ee20595daa96
6
+ metadata.gz: e9b872a2ae10e5b6e6f0f7e21973bac443592652913f583fe0a173ff6a25c545dfa069baa508a1f868d22aecad4c718318947ac47ff0b24e45da4dd7118fb812
7
+ data.tar.gz: cf36c88ddf8c0291c4f633ec6b6ae19d1363473eb204962a6efa64b4c10c1fb027dfe1fda5446903405ac427a7a881085a0cdbe02b6d851b82f14ad31d89767f
data/VERSION CHANGED
@@ -1 +1 @@
1
- 13.0.0
1
+ 14.0.0
@@ -365,6 +365,7 @@ module Cucumber
365
365
  optional :string, :media_type, 5
366
366
  optional ::Cucumber::Messages::Attachment::ContentEncoding, :content_encoding, 6
367
367
  optional :string, :file_name, 7
368
+ optional :string, :url, 8
368
369
  end
369
370
 
370
371
  class Pickle
@@ -5,8 +5,13 @@ module Cucumber
5
5
  class NdjsonToMessageEnumerator < Enumerator
6
6
  def initialize(io)
7
7
  super() do |yielder|
8
- io.each_line do |json|
9
- m = Cucumber::Messages::Envelope.from_json(json)
8
+ io.each_line do |line|
9
+ next if line.strip.empty?
10
+ begin
11
+ m = Cucumber::Messages::Envelope.from_json(line)
12
+ rescue => e
13
+ raise "Not JSON: #{line.strip}"
14
+ end
10
15
  yielder.yield(m)
11
16
  end
12
17
  end
@@ -69,6 +69,22 @@ module Cucumber
69
69
  expect(incoming_messages.to_a).to(eq(outgoing_messages))
70
70
  end
71
71
 
72
+ it "ignores empty lines" do
73
+ outgoing_messages = [
74
+ Envelope.new(source: Source.new(data: 'Feature: Hello')),
75
+ Envelope.new(attachment: Attachment.new(binary: [1,2,3,4].pack('C*')))
76
+ ]
77
+
78
+ io = StringIO.new
79
+ write_outgoing_messages(outgoing_messages, io)
80
+ io.write("\n\n")
81
+
82
+ io.rewind
83
+ incoming_messages = NdjsonToMessageEnumerator.new(io)
84
+
85
+ expect(incoming_messages.to_a).to(eq(outgoing_messages))
86
+ end
87
+
72
88
  it "ignores missing fields" do
73
89
  io = StringIO.new
74
90
  io.puts('{"unused": 99}')
@@ -79,6 +95,16 @@ module Cucumber
79
95
  expect(incoming_messages.to_a).to(eq([Envelope.new]))
80
96
  end
81
97
 
98
+ it "includes offending line in error message" do
99
+ io = StringIO.new
100
+ io.puts('BLA BLA')
101
+
102
+ io.rewind
103
+ incoming_messages = NdjsonToMessageEnumerator.new(io)
104
+
105
+ expect { incoming_messages.to_a }.to(raise_error('Not JSON: BLA BLA'))
106
+ end
107
+
82
108
  def write_outgoing_messages(messages, out)
83
109
  messages.each do |message|
84
110
  message.write_ndjson_to(out)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber-messages
3
3
  version: !ruby/object:Gem::Version
4
- version: 13.0.0
4
+ version: 14.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aslak Hellesøy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-07 00:00:00.000000000 Z
11
+ date: 2021-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: protobuf-cucumber
@@ -39,7 +39,7 @@ dependencies:
39
39
  version: '13.0'
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
- version: 13.0.1
42
+ version: 13.0.3
43
43
  type: :development
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -49,27 +49,27 @@ dependencies:
49
49
  version: '13.0'
50
50
  - - ">="
51
51
  - !ruby/object:Gem::Version
52
- version: 13.0.1
52
+ version: 13.0.3
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: rspec
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
57
  - - "~>"
58
58
  - !ruby/object:Gem::Version
59
- version: '3.9'
59
+ version: '3.10'
60
60
  - - ">="
61
61
  - !ruby/object:Gem::Version
62
- version: 3.9.0
62
+ version: 3.10.0
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: '3.9'
69
+ version: '3.10'
70
70
  - - ">="
71
71
  - !ruby/object:Gem::Version
72
- version: 3.9.0
72
+ version: 3.10.0
73
73
  description: Protocol Buffer messages for Cucumber's inter-process communication
74
74
  email: cukes@googlegroups.com
75
75
  executables: []
@@ -122,11 +122,11 @@ requirements: []
122
122
  rubygems_version: 3.1.2
123
123
  signing_key:
124
124
  specification_version: 4
125
- summary: cucumber-messages-13.0.0
125
+ summary: cucumber-messages-14.0.0
126
126
  test_files:
127
- - spec/cucumber/messages/time_conversion_spec.rb
127
+ - spec/capture_warnings.rb
128
+ - spec/cucumber/messages/id_generator_spec.rb
128
129
  - spec/cucumber/messages/ndjson_serialization_spec.rb
129
- - spec/cucumber/messages/version_spec.rb
130
130
  - spec/cucumber/messages/protobuf_serialization_spec.rb
131
- - spec/cucumber/messages/id_generator_spec.rb
132
- - spec/capture_warnings.rb
131
+ - spec/cucumber/messages/time_conversion_spec.rb
132
+ - spec/cucumber/messages/version_spec.rb