Behavior specification for Gavel, validator of HTTP transactions
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.
gavel-spec
This repository contains implementation-independent behavior specification of Gavel. It's written in Gherkin, language used by Cucumber. Two main benefits are:
Examples are made in raw HTTP to focus on implementation independence.
To use the specification in your project and test against it, install it as npm package (or include as a git submodule):
$ 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
...
It's also possible to get path to the directory with features from JavaScript:
var featuresPath = require('gavel-spec').featuresPath;
console.log(featuresPath); // prints '/.../node_modules/gavel-spec/features/'
Use Cucumber for testing.
Currently publishing of a new version of the generated documentation is done manually:
gem install relish
relish versions:add apiary/gavel:1.1.0
(the 1.1.0
should be the same number which appears on npm as the latest package version)relish push apiary/gavel:1.1.0 path ./features/
Steps 2-3 has been simplified as npm run docs:publish
command.