Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updated documentation, changed utf-8 test to use mock server

  • Loading branch information...
commit 1c3dac5c8ff4fe0951b98a0c8e0771f9d3de5780 1 parent 43c6555
@pascalopitz authored
View
1  README.md
@@ -119,3 +119,4 @@ Thanks to people that took time to fix some things.
aahoughton
andho
+jney
View
534 docs/beanstalk_client.html
266 additions, 268 deletions not shown
View
8 docs/docco.css
@@ -21,6 +21,12 @@ h1, h2, h3, h4, h5, h6 {
h1 {
margin-top: 40px;
}
+hr {
+ border: 0 none;
+ border-top: 1px solid #e5e5ee;
+ height: 1px;
+ margin: 20px 0;
+}
#container {
position: relative;
}
@@ -115,7 +121,7 @@ table td {
}
pre, tt, code {
font-size: 12px; line-height: 18px;
- font-family: Monaco, Consolas, "Lucida Console", monospace;
+ font-family: Menlo, Monaco, Consolas, "Lucida Console", monospace;
margin: 0; padding: 0;
}
View
2  package.json
@@ -2,7 +2,7 @@
"name": "nodestalker"
, "description": "A Beanstalk client for node.js"
, "keywords": ["beanstalkd", "queue"]
- , "version": "0.1.4"
+ , "version": "0.1.6"
, "author": "Pascal Opitz <contact@pascalopitz.com> (http://blog.pascalopitz.com)"
, "repository": {
"type": "git"
View
3  tests/test_put_stats_job_delete.js
@@ -53,8 +53,7 @@ client.put('test').onSuccess(function(job_data) {
var test_id = job_data[0];
client.stats_job(test_id).onSuccess(function(data) {
- console.log('here');
- assert.ok(data);
+ assert.ok(data);
assert.ok(data.id);
assert.equal(test_id, data.id);
success = true;
View
34 tests/test_utf8.js
@@ -1,11 +1,39 @@
-console.log('testing utf8');
var assert = require('assert');
var bs = require('../lib/beanstalk_client');
-var client = bs.Client();
+
+console.log('testing utf8');
+
+var port = 11333;
+
+var net = require('net');
+var cnt = 0;
+
+var mock_server = net.createServer(function(conn) {
+ conn.on('data', function(data) {
+
+
+ if(String(data).indexOf('put') > -1) {
+ var input = data.toString().split('\r\n');
+
+ assert.equal(input[1], "ééééé");
+ assert.equal(Buffer.byteLength(input[1], 'utf8'), Buffer.byteLength("ééééé", 'utf8'));
+
+ cnt += 1;
+ conn.write("INSERTED "+cnt+"\r\n");
+ }
+
+ if(String(data) == "use default\r\n") {
+ conn.write('USING default\r\n');
+ mock_server.close();
+ }
+ });
+});
+mock_server.listen(port);
+
+var client = bs.Client('127.0.0.1:' + port);
client.use('default').onSuccess(function(data) {
client.put("ééééé", 100, 0).onSuccess(function(data) {
- console.log(data);
assert.ok(!isNaN(data[0]));
client.disconnect();
});
Please sign in to comment.
Something went wrong with that request. Please try again.