Giter VIP home page Giter VIP logo

gavel-spec's Introduction

Behavior spec for Gavel, validator of HTTP transactions

Relish docs npm version

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.

gavel-spec's People

Contributors

abtris avatar akshayjshah avatar drewda avatar honzajavorek avatar kuba-kubula avatar kylef avatar marcelogo avatar tkawachi avatar zdne avatar zorbash avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.