updated to v2

This commit is contained in:
Tony Tam
2012-07-11 09:57:27 -07:00
parent a2c1c18f75
commit d2eb882e52
278 changed files with 46216 additions and 11130 deletions

29
node_modules/request/tests/test-cookie.js generated vendored Normal file
View File

@@ -0,0 +1,29 @@
var Cookie = require('../vendor/cookie')
, assert = require('assert');
var str = 'sid="s543qactge.wKE61E01Bs%2BKhzmxrwrnug="; path=/; httpOnly; expires=Sat, 04 Dec 2010 23:27:28 GMT';
var cookie = new Cookie(str);
// test .toString()
assert.equal(cookie.toString(), str);
// test .path
assert.equal(cookie.path, '/');
// test .httpOnly
assert.equal(cookie.httpOnly, true);
// test .name
assert.equal(cookie.name, 'sid');
// test .value
assert.equal(cookie.value, '"s543qactge.wKE61E01Bs%2BKhzmxrwrnug="');
// test .expires
assert.equal(cookie.expires instanceof Date, true);
// test .path default
var cookie = new Cookie('foo=bar', { url: 'http://foo.com/bar' });
assert.equal(cookie.path, '/bar');
console.log('All tests passed');