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

37
node_modules/request/tests/test-errors.js generated vendored Normal file
View File

@@ -0,0 +1,37 @@
var server = require('./server')
, events = require('events')
, assert = require('assert')
, request = require('../main.js')
;
var local = 'http://localhost:8888/asdf'
try {
request({uri:local, body:{}})
assert.fail("Should have throw")
} catch(e) {
assert.equal(e.message, 'Argument error, options.body.')
}
try {
request({uri:local, multipart: 'foo'})
assert.fail("Should have throw")
} catch(e) {
assert.equal(e.message, 'Argument error, options.multipart.')
}
try {
request({uri:local, multipart: [{}]})
assert.fail("Should have throw")
} catch(e) {
assert.equal(e.message, 'Body attribute missing in multipart.')
}
try {
request(local, {multipart: [{}]})
assert.fail("Should have throw")
} catch(e) {
assert.equal(e.message, 'Body attribute missing in multipart.')
}
console.log("All tests passed.")