Permalink
Browse files

Added cookie construction test.

  • Loading branch information...
cskr committed Jan 10, 2011
1 parent fca2660 commit f191094258cdb323d9973d6294e19d1305cef5b5
Showing with 20 additions and 0 deletions.
  1. +19 −0 test/simple/cookie-test.js
  2. +1 −0 test/simple/test.js
View
@@ -0,0 +1,19 @@
+var Cookie = require('../../grasshopper/lib/cookie').api.Cookie,
+ assert = require('assert');
+
+var suite = {name: 'Cookie Tests'};
+exports.suite = suite;
+
+suite.tests = {
+ 'Cookie construction.': function(next) {
+ var c = new Cookie('language', 'JS');
+ assert.equal(c.name, 'language');
+ assert.equal(c.value, 'JS');
+ assert.equal(c.path, '/');
+ assert.equal(c.httpOnly, true);
+ next();
+ }
+};
+
+if(process.argv[1] == __filename)
+ require('../common/ghunit').test(suite);
View
@@ -8,6 +8,7 @@ var suites = [
require('./routes-test').suite,
require('./wrapper-test').suite,
require('./params-test').suite,
+ require('./cookie-test').suite,
require('./context-test').suite
];

0 comments on commit f191094

Please sign in to comment.