Skip to content

Instantly share code, notes, and snippets.

@DamonOehlman
Created September 26, 2012 22:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DamonOehlman/3791015 to your computer and use it in GitHub Desktop.
Save DamonOehlman/3791015 to your computer and use it in GitHub Desktop.
testrest yaml file fornat
opts:
baseUrl: http://localhost:3000
tests:
- it: returns Hi for /
get: /
expect:
status: 2xx
body: Hi
- it: returns a 404 for /does-not-exist
get: /does-not-exist
expect: 404
- it: returns valid JSON for /json-test
get: /json-test
expect:
status: 2xx
body:
first: Roger
last: Rabbit
- it: partial JSON tests are ok too
get: /json-test
expect:
status: 2xx
body:
first: Roger
- it: expects the contents of empty to be an empty array
get: /empty
expect:
status: 2xx
body-match: "[]"
- it: expects that we can compare contents against a file
get: /test.txt
expect:
status: 2xx
body-match: "data/text.txt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment