gavel-spec

Behavior specification for Gavel, validator of HTTP transactions

Github星跟踪图

Behavior spec for Gavel, validator of HTTP transactions

Relish docs
npm version
Greenkeeper badge

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.

Implementations

Documentation

About gavel-spec

This repository contains implementation-independent behavior specification of Gavel. It's written in Gherkin, language used by Cucumber. Two main benefits are:

  • 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.

Usage

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.

Publishing Documentation

Currently publishing of a new version of the generated documentation is done manually:

  1. Install Relish CLI: gem install relish
  2. Add current version: 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)
  3. 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.

主要指标

概览
名称与所有者apiaryio/gavel-spec
主编程语言Gherkin
编程语言JavaScript (语言数: 2)
平台
许可证MIT License
所有者活动
创建于2013-07-03 14:28:28
推送于2022-05-19 03:25:37
最后一次提交2021-02-08 16:15:18
发布数14
最新版本名称v5.0.0 (发布于 )
第一版名称v1.0.0 (发布于 2016-08-05 15:23:11)
用户参与
星数104
关注者数17
派生数11
提交数177
已启用问题?
问题数24
打开的问题数6
拉请求数41
打开的拉请求数2
关闭的拉请求数39
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?