UNPKG

api-bdd-test

Version:

use the bdd(cucumber) to test the RESTfull API

15 lines (12 loc) 432 B
extend = require 'util-ex/lib/_extend' module.exports = (aLanguage, aVocabulary)-> oldLocalise = aLanguage.localise newLocalise = (keyword)-> result = @vocabulary[keyword] result = @_localise_ keyword unless result result aLanguage.vocabulary = extend {}, aLanguage.vocabulary, aVocabulary if oldLocalise isnt newLocalise aLanguage.localise = newLocalise aLanguage._localise_ = oldLocalise aLanguage