-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Failures:
1) Cucumber::Messages omits empty string fields in output
Failure/Error: expect(json).to eq("{\"source\":{}}\n")
expected: "{\"source\":{}}\n"
got: "{\"source\":{\"data\":\"\"}}\n"
(compared using ==)
Diff:
@@ -1,2 +1,2 @@
-{"source":{}}
+{"source":{"data":""}}
# ./spec/cucumber/messages/ndjson_serialization_spec.rb:22:in `block (2 levels) in <module:Messages>'
2) Cucumber::Messages omits empty number fields in output
Failure/Error: expect(json).to eq('{"testCaseStarted":{"timestamp":{}}}' + "\n")
expected: "{\"testCaseStarted\":{\"timestamp\":{}}}\n"
got: "{\"test_case_started\":{\"timestamp\":{\"seconds\":0}}}\n"
(compared using ==)
Diff:
@@ -1,2 +1,2 @@
-{"testCaseStarted":{"timestamp":{}}}
+{"test_case_started":{"timestamp":{"seconds":0}}}
# ./spec/cucumber/messages/ndjson_serialization_spec.rb:39:in `block (2 levels) in <module:Messages>'
3) Cucumber::Messages omits empty repeated fields in output
Failure/Error: expect(json).to eq('{"parameterType":{}}' + "\n")
expected: "{\"parameterType\":{}}\n"
got: "{\"parameter_type\":{}}\n"
(compared using ==)
Diff:
@@ -1,2 +1,2 @@
-{"parameterType":{}}
+{"parameter_type":{}}
# ./spec/cucumber/messages/ndjson_serialization_spec.rb:54:in `block (2 levels) in <module:Messages>'
4) Cucumber::Messages can be serialised over an ndjson stream
Failure/Error: raise "Not JSON: #{line.strip}"
RuntimeError:
Not JSON: {"source":{"data":"Feature: Hello"}}
# ./lib/cucumber/messages/ndjson_to_message_enumerator.rb:13:in `rescue in block (2 levels) in initialize'
# ./lib/cucumber/messages/ndjson_to_message_enumerator.rb:10:in `block (2 levels) in initialize'
# ./lib/cucumber/messages/ndjson_to_message_enumerator.rb:8:in `each_line'
# ./lib/cucumber/messages/ndjson_to_message_enumerator.rb:8:in `block in initialize'
# ./spec/cucumber/messages/ndjson_serialization_spec.rb:69:in `each'
# ./spec/cucumber/messages/ndjson_serialization_spec.rb:69:in `each'
# ./spec/cucumber/messages/ndjson_serialization_spec.rb:69:in `to_a'
# ./spec/cucumber/messages/ndjson_serialization_spec.rb:69:in `block (2 levels) in <module:Messages>'
# ------------------
# --- Caused by: ---
# NoMethodError:
# undefined method `from_json' for Cucumber::Messages::Envelope:Class
# Did you mean? to_json
# ./lib/cucumber/messages/ndjson_to_message_enumerator.rb:11:in `block (2 levels) in initialize'
5) Cucumber::Messages ignores empty lines
Failure/Error: raise "Not JSON: #{line.strip}"
RuntimeError:
Not JSON: {"source":{"data":"Feature: Hello"}}
# ./lib/cucumber/messages/ndjson_to_message_enumerator.rb:13:in `rescue in block (2 levels) in initialize'
# ./lib/cucumber/messages/ndjson_to_message_enumerator.rb:10:in `block (2 levels) in initialize'
# ./lib/cucumber/messages/ndjson_to_message_enumerator.rb:8:in `each_line'
# ./lib/cucumber/messages/ndjson_to_message_enumerator.rb:8:in `block in initialize'
# ./spec/cucumber/messages/ndjson_serialization_spec.rb:85:in `each'
# ./spec/cucumber/messages/ndjson_serialization_spec.rb:85:in `each'
# ./spec/cucumber/messages/ndjson_serialization_spec.rb:85:in `to_a'
# ./spec/cucumber/messages/ndjson_serialization_spec.rb:85:in `block (2 levels) in <module:Messages>'
# ------------------
# --- Caused by: ---
# NoMethodError:
# undefined method `from_json' for Cucumber::Messages::Envelope:Class
# Did you mean? to_json
# ./lib/cucumber/messages/ndjson_to_message_enumerator.rb:11:in `block (2 levels) in initialize'
6) Cucumber::Messages ignores missing fields
Failure/Error: raise "Not JSON: #{line.strip}"
RuntimeError:
Not JSON: {"unused": 99}
# ./lib/cucumber/messages/ndjson_to_message_enumerator.rb:13:in `rescue in block (2 levels) in initialize'
# ./lib/cucumber/messages/ndjson_to_message_enumerator.rb:10:in `block (2 levels) in initialize'
# ./lib/cucumber/messages/ndjson_to_message_enumerator.rb:8:in `each_line'
# ./lib/cucumber/messages/ndjson_to_message_enumerator.rb:8:in `block in initialize'
# ./spec/cucumber/messages/ndjson_serialization_spec.rb:95:in `each'
# ./spec/cucumber/messages/ndjson_serialization_spec.rb:95:in `each'
# ./spec/cucumber/messages/ndjson_serialization_spec.rb:95:in `to_a'
# ./spec/cucumber/messages/ndjson_serialization_spec.rb:95:in `block (2 levels) in <module:Messages>'
# ------------------
# --- Caused by: ---
# NoMethodError:
# undefined method `from_json' for Cucumber::Messages::Envelope:Class
# Did you mean? to_json
# ./lib/cucumber/messages/ndjson_to_message_enumerator.rb:11:in `block (2 levels) in initialize'
Finished in 0.01757 seconds (files took 0.32449 seconds to load)
16 examples, 6 failures
Metadata
Metadata
Assignees
Labels
No labels