-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
885 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
## Cannonical path convention for transaction names | ||
|
||
- when processing multiple blueprint, `API Name` is a part of the transaction name | ||
- when there is no API Name in the blueprint, it will use `filename` instead | ||
- when group is not present, transaction starts with a space (bug #168) | ||
- when resource name and action name is empty, URI and method is used instead | ||
- when multiple request response pairs are present, it uses generic sequential example names | ||
|
||
## Fundamental indeterminism | ||
- When there are compiled duplicate paths, it does not throw any error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/bin/sh | ||
cd $(dirname $0)/.. | ||
find ./test/ -name '*-test.coffee' | xargs ./node_modules/.bin/mocha --timeout 20000 --reporter spec --compilers 'coffee:coffee-script/register' | ||
./node_modules/.bin/mocha --timeout 120000 --reporter spec --compilers 'coffee:coffee-script/register' --recursive './test/**/*-test.coffee' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
fs = require 'fs' | ||
yaml = require 'js-yaml' | ||
clone = require 'clone' | ||
|
||
configUtils = {} | ||
|
||
configUtils.save = (argsOrigin, path) -> | ||
path ?= './dredd.yml' | ||
|
||
args = clone argsOrigin | ||
|
||
args['blueprint'] = args['_'][0] | ||
args['endpoint'] = args['_'][1] | ||
|
||
for key, value of args | ||
delete args[key] if key.length == 1 | ||
|
||
delete args['$0'] | ||
delete args['_'] | ||
|
||
yamlArgs = yaml.dump args | ||
fs.writeFileSync path, yamlArgs | ||
|
||
|
||
configUtils.load = (path) -> | ||
path ?= './dredd.yml' | ||
|
||
yamlData = fs.readFileSync path | ||
data = yaml.safeLoad yamlData | ||
|
||
data['_'] = [data['blueprint'], data['endpoint']] | ||
|
||
delete data['blueprint'] | ||
delete data['endpoint'] | ||
|
||
data | ||
|
||
configUtils.parseCustom = (customArray) -> | ||
output = {} | ||
if Array.isArray customArray | ||
for string in customArray | ||
splitted = string.split(/:(.+)?/) | ||
output[splitted[0]] = splitted[1] | ||
|
||
output | ||
|
||
module.exports = configUtils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.