Skip to content

Instantly share code, notes, and snippets.

@ryankennedy
Last active September 6, 2017 05:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryankennedy/f3b316261267dbd13a2e27e6881c2b22 to your computer and use it in GitHub Desktop.
Save ryankennedy/f3b316261267dbd13a2e27e6881c2b22 to your computer and use it in GitHub Desktop.
Cucumber definition for a simple Protocol Buffer parsing test
Feature: Parsing Protocol Buffer schemas
Scenario: Parsing a valid Protocol Buffer schema
Given a Protocol Buffer schema named my_message.proto with body
"""
syntax = "proto3";
message MyMessage {
string message_content = 1;
}
"""
When my_message.proto is parsed
Then parsing my_message.proto should succeed
And my_message.proto should have a message named MyMessage with the fields
| type | name | tag |
| string | message_content | 1 |
Scenario: Parsing an invalid Protocol Buffer schema
Given a Protocol Buffer schema named not_really_a.proto with body
"""
this is not a protobuf schema
"""
When not_really_a.proto is parsed
Then parsing not_really_a.proto should fail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment