UNPKG

nodulator

Version:

Complete NodeJS Framework for Restfull APIs

42 lines (33 loc) 1.11 kB
/* * Copyright 2012-2013 the original author or authors * @license MIT, see LICENSE.txt for details * * @author Scott Andrews */ (function (buster, define) { 'use strict'; var assert, refute; assert = buster.assertions.assert; refute = buster.assertions.refute; define('rest/util/base64-test', function (require) { var base64 = require('rest/util/base64'); buster.testCase('rest/util/base64', { 'should base64 encode strings': function () { assert.equals('Zm9v', base64.encode('foo')); }, 'should base64 decode strings': function () { assert.equals('foo', base64.decode('Zm9v')); } }); }); }( this.buster || require('buster'), typeof define === 'function' && define.amd ? define : function (id, factory) { var packageName = id.split(/[\/\-]/)[0], pathToRoot = id.replace(/[^\/]+/g, '..'); pathToRoot = pathToRoot.length > 2 ? pathToRoot.substr(3) : pathToRoot; factory(function (moduleId) { return require(moduleId.indexOf(packageName) === 0 ? pathToRoot + moduleId.substr(packageName.length) : moduleId); }); } // Boilerplate for AMD and Node ));