Permalink
Browse files

Started tests with utils.base64

  • Loading branch information...
1 parent d92fcb5 commit c41fcdc269d4ed599ea8d46b73d409d641111b4a @tj tj committed Sep 15, 2010
Showing with 96 additions and 7 deletions.
  1. +3 −0 .gitmodules
  2. +6 −0 Makefile
  3. +0 −7 lib/ns3.js
  4. +13 −0 lib/ns3/auth.js
  5. +22 −0 lib/ns3/index.js
  6. +22 −0 lib/ns3/utils.js
  7. +1 −0 support/expresso
  8. +12 −0 test/ns3.test.js
  9. +17 −0 test/utils.test.js
View
@@ -0,0 +1,3 @@
+[submodule "support/expresso"]
+ path = support/expresso
+ url = git://github.com/visionmedia/expresso.git
View
@@ -0,0 +1,6 @@
+
+test:
+ @./support/expresso/bin/expresso test/*.test.js \
+ -I lib
+
+.PHONY: test
View
@@ -1,7 +0,0 @@
-
-/*!
- * ns3
- * Copyright(c) 2010 LearnBoost <dev@learnboost.com>
- * MIT Licensed
- */
-
View
@@ -0,0 +1,13 @@
+
+/*!
+ * ns3 - auth
+ * Copyright(c) 2010 LearnBoost <dev@learnboost.com>
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var http = require('http')
+ , fs = require('fs');
View
@@ -0,0 +1,22 @@
+
+/*!
+ * ns3
+ * Copyright(c) 2010 LearnBoost <dev@learnboost.com>
+ * MIT Licensed
+ */
+
+/**
+ * Library version.
+ *
+ * @type String
+ */
+
+exports.version = '0.0.1';
+
+/**
+ * Expose utilities.
+ *
+ * @type Object
+ */
+
+exports.utils = require('./utils');
View
@@ -0,0 +1,22 @@
+
+/*!
+ * ns3 - utils
+ * Copyright(c) 2010 LearnBoost <dev@learnboost.com>
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var crypto = require('crypto');
+
+exports.base64 = {
+ encode: function(str){
+ return new Buffer(str).toString('base64');
+ },
+
+ decode: function(str){
+ return new Buffer(str, 'base64').toString();
+ }
+};
Submodule expresso added at d05bb6
View
@@ -0,0 +1,12 @@
+
+/**
+ * Module dependencies.
+ */
+
+var ns3 = require('ns3');
+
+module.exports = {
+ 'test .version': function(assert){
+ assert.match(ns3.version, /^\d+\.\d+\.\d+$/);
+ }
+};
View
@@ -0,0 +1,17 @@
+
+/**
+ * Module dependencies.
+ */
+
+var ns3 = require('ns3')
+ , utils = ns3.utils;
+
+module.exports = {
+ 'test .base64.encode()': function(assert){
+ assert.equal('aGV5', utils.base64.encode('hey'));
+ },
+
+ 'test .base64.decode()': function(assert){
+ assert.equal('hey', utils.base64.decode('aGV5'));
+ }
+};

0 comments on commit c41fcdc

Please sign in to comment.