Logo: Relish

  1. Sign up
  2. Sign in

Project: Gavel 0.1

  • Change version

    1. 0.1

Command-line interface

  • @nodejs
  • @cli

Installation: npm install -g gavel

Background
Given
you record expected raw HTTP messages:
curl -s --trace - http://httpbin.org/ip | curl-trace-parser > expected 
And
you record real raw HTTP messages:
curl -s --trace - http://httpbin.org/ip | curl-trace-parser > real
Scenarios
  • @stable
Read and validate real raw HTTP message from STDIN
When
you validate the message using the following Gavel command:
cat real | gavel expected
Then
exit status is 0
  • @stable
Exit status for invalid message
When
a header is missing in real messages:
cat real | grep -v 'Access-Control-Allow-Origin' > real_without_cors
And
you validate the message using the following Gavel command:
cat real_without_cors | curl-trace-parser | gavel expected
Then
exit status is 1

Last published 8 months ago by Adam Kliment.