Permalink
Browse files

replaced sys with util

fixed tests, now using mocked servers
  • Loading branch information...
1 parent cebe162 commit d661330b4f2ff6f58397173140fa70dda48dcc5e Pascal Opitz committed Jun 24, 2012
View
@@ -104,7 +104,7 @@ Please make sure beanstalkd is running on the default settings.
To run all tests:
- find tests/ | grep .js | xargs -n1 node
+ npm test
## CREDIT
View
@@ -1,7 +1,7 @@
// Includes
var events = require('events'),
net = require('net'),
- sys = require('sys');
+ util = require('util');
// ##yaml wrapper
// because yaml doesn't like beanstalk
@@ -16,7 +16,7 @@ var yaml = new function() {
.replace(/(\w)\-(\w)/mgi, '$1_$2') // replace minuses in hash names
.replace(/\n([\w\d_-]+)\:\ ([\.\,\w\d_-]+)/mig, '\n $1: \'$2\'') // format hashes
;
-
+
try {
return require('yaml').eval(corrected);
} catch(e) {
@@ -60,7 +60,7 @@ BeanstalkJob.create = function(data) {
function BeanstalkCommand() {
events.EventEmitter.call(this);
};
-sys.inherits(BeanstalkCommand, events.EventEmitter);
+util.inherits(BeanstalkCommand, events.EventEmitter);
BeanstalkCommand.prototype.onSuccess = function(callback) {
this.addListener('command_done', function(data) {
@@ -114,7 +114,7 @@ function BeanstalkClient() {
this.conn;
this.default_priority = 10;
};
-sys.inherits(BeanstalkClient, events.EventEmitter);
+util.inherits(BeanstalkClient, events.EventEmitter);
// Singleton like method that returns an instance
BeanstalkClient.prototype.Instance = function(server) {
@@ -188,6 +188,7 @@ BeanstalkClient.prototype.command = function(obj) {
// disconnects a client
BeanstalkClient.prototype.disconnect = function() {
this.conn.end();
+ this.conn.destroy();
this.conn = null;
};

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit d661330

Please sign in to comment.