Skip to content

Commit

Permalink
mods to nock, essentially creating my own lightweight fork.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alastair Brunton committed Apr 11, 2012
1 parent 32b5ed9 commit cc02c80
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 115 deletions.
10 changes: 1 addition & 9 deletions index.js
@@ -1,9 +1 @@
var recorder = require('./lib/recorder') module.exports = require('./lib/scope');
module.exports = require('./lib/scope');

module.exports.recorder = {
rec : recorder.record
, clear : recorder.clear
, play : recorder.outputs
};
module.exports.restore = recorder.restore;
6 changes: 1 addition & 5 deletions lib/intercept.js
Expand Up @@ -35,11 +35,7 @@ function remove(interceptor) {
function stringifyRequest(options) { function stringifyRequest(options) {
var method = options.method || 'GET'; var method = options.method || 'GET';
var path = options.path; var path = options.path;
var body = options.body; return method + ' ' + path;
if (body && typeof(body) !== 'string') {
body = body.toString();
}
return method + ' ' + path + ' ' + body;
} }


function getHeader(request, name) { function getHeader(request, name) {
Expand Down
98 changes: 0 additions & 98 deletions lib/recorder.js

This file was deleted.

5 changes: 2 additions & 3 deletions lib/scope.js
Expand Up @@ -97,9 +97,8 @@ function startScope(basePath) {
} }


var matchKey = method + ' ' + proto + '://' + options.host + path; var matchKey = method + ' ' + proto + '://' + options.host + path;
// if (body) { matchKey += (' ' + body); } matches = matchKey === this._key;
matches = matchKey === this._key; console.log('matching ' + matchKey + ' to ' + this._key + ': ' + matches);
logger('matching ' + matchKey + ' to ' + this._key + ': ' + matches);
return matches; return matches;
} }


Expand Down

0 comments on commit cc02c80

Please sign in to comment.