Comparing version 0.5.4 to 0.5.5
@@ -28,5 +28,3 @@ var http = require('http'); | ||
if (requestBody) { | ||
ret.push(", '"); | ||
ret.push(JSON.stringify(requestBody)); | ||
ret.push("'"); | ||
} | ||
@@ -33,0 +31,0 @@ ret.push(")\n"); |
{ "name" : "nock" | ||
, "description" : "HTTP Server mocking for Node.js" | ||
, "tags" : ["Mock", "HTTP", "testing", "isolation"] | ||
, "version" : "0.5.4" | ||
, "version" : "0.5.5" | ||
, "author" : "Pedro Teixeira <pedro.teixeira@gmail.com>" | ||
@@ -6,0 +6,0 @@ , "contributors" : |
@@ -691,1 +691,34 @@ var nock = require('../.') | ||
}); | ||
tap.test("same URI", function(t) { | ||
var scope = nock('http://sameurii.com') | ||
.get('/abc') | ||
.reply(200, 'first one') | ||
.get('/abc') | ||
.reply(200, 'second one'); | ||
http.get({ | ||
host: 'sameurii.com' | ||
, path: '/abc' | ||
}, function(res) { | ||
res.on('data', function(data) { | ||
res.setEncoding('utf8'); | ||
t.equal(data.toString(), 'first one', 'should be qual to first reply'); | ||
res.on('end', function() { | ||
http.get({ | ||
host: 'sameurii.com' | ||
, path: '/abc' | ||
}, function(res) { | ||
res.setEncoding('utf8'); | ||
res.on('data', function(data) { | ||
t.equal(data.toString(), 'second one', 'should be qual to second reply'); | ||
res.on('end', function() { | ||
scope.done(); | ||
t.end(); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); |
@@ -22,3 +22,3 @@ var nock = require('../.') | ||
t.equal(ret.length, 1); | ||
t.equal(ret[0].indexOf("\nnock('expensecat.iriscouch.com')\n .post('/', '\"ABCDEF\"')\n .reply("), 0); | ||
t.equal(ret[0].indexOf("\nnock('expensecat.iriscouch.com')\n .post('/'\"ABCDEF\")\n .reply("), 0); | ||
t.end(); | ||
@@ -25,0 +25,0 @@ }); |
39841
1129