Behavior spec for Gavel, validator of HTTP transactions
What is Gavel?
Gavel detects important differences between actual and expected HTTP transactions (HTTP request and response pairs). Gavel also decides whether the actual HTTP transaction is valid or not.
- Any Gavel implementation can be tested against the specification, which ensures the behavior is uniform.
- Documentation at Relish is generated from the specification, which ensures it's always up-to-date.
Examples are made in raw HTTP to focus on implementation independence.
$ npm install gavel-spec...$ find ./node_modules/gavel-spec/features/**/*.feature./node_modules/gavel-spec/features/expectations/body_json_example.feature./node_modules/gavel-spec/features/expectations/body_text_example.feature./node_modules/gavel-spec/features/expectations/headers.feature./node_modules/gavel-spec/features/expectations/status_code.feature...
var featuresPath = featuresPath;console; // prints '/.../node_modules/gavel-spec/features/'
Use Cucumber for testing.
Currently publishing of a new version of the generated documentation is done manually:
- Install Relish CLI:
gem install relish
- Add current version:
relish versions:add apiary/gavel:1.1.0(the
1.1.0should be the same number which appears on npm as the latest package version)
- Publish new version of the documentation:
relish push apiary/gavel:1.1.0 path ./features/
Steps 2-3 has been simplified as
npm run docs:publish command.