Skip to content

Commit

Permalink
bitcoin errors should pass err object in callback
Browse files Browse the repository at this point in the history
  • Loading branch information
freewil committed Feb 23, 2012
1 parent 53d0381 commit 79ab657
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .gitignore
@@ -1 +1,2 @@
node_modules
node_modules/
test/config.js
25 changes: 15 additions & 10 deletions test/api.js
Expand Up @@ -6,12 +6,7 @@ var test = {
account: "test"
};

var config = {
host: 'localhost',
port: 8332,
user: 'jb55',
pass: 'thisisthepassword'
};
var config = require('./config');

// end test variables

Expand Down Expand Up @@ -143,9 +138,19 @@ vows.describe('api').addBatch({
}
}
}
},
"creating a bitcoin related error": {
topic: function(client) {
client.cmd('nomethod', this.callback);
},
"should create non-null err in callback": function(err, expectedValue) {
assert.deepEqual(err, {
code: -32601,
message: 'Method not found'
});
assert.equal(expectedValue, undefined);
}
}
},

}
}).export(module);


6 changes: 6 additions & 0 deletions test/config.example.js
@@ -0,0 +1,6 @@
module.exports = {
host: 'localhost',
port: 8332,
user: 'jb55',
pass: 'thisisthepassword'
};

0 comments on commit 79ab657

Please sign in to comment.