Skip to content

Instantly share code, notes, and snippets.

@skrat
Created September 26, 2011 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skrat/1243458 to your computer and use it in GitHub Desktop.
Save skrat/1243458 to your computer and use it in GitHub Desktop.
Fixing queue args test
diff --git a/test/harness.js b/test/harness.js
index 1fefb76..3b4954c 100644
--- a/test/harness.js
+++ b/test/harness.js
@@ -13,7 +13,11 @@ var implOpts = {
defaultExchangeName: 'amq.topic'
};
-global.connection = amqp.createConnection(options, implOpts);
+global.makeConnection = function() {
+ return amqp.createConnection(options, implOpts)
+};
+
+global.connection = makeConnection();
global.connection.addListener('error', function (e) {
throw e;
diff --git a/test/test-queue-args.js b/test/test-queue-args.js
index 35e2033..e7679eb 100644
--- a/test/test-queue-args.js
+++ b/test/test-queue-args.js
@@ -10,13 +10,13 @@ connection.on('ready', function() {
function doCheck(conn1, qName) {
var args1 = {'x-expires': 300};
- conn1.queue( qName, {'arguments': args1 }, function(q1) {
+ conn1.queue( qName, {autoDelete: false, durable: true, 'arguments': args1}, function(q1) {
puts("queue declared");
assert.deepEqual(q1.options.arguments, args1, 'arguments to not match');
- var conn2 = amqp.createConnection({});
+ var conn2 = makeConnection();
conn2.on('ready', function() {
var q2 = conn2.queue(
- qName, {'arguments': {'x-expires': 301}}, function() {
+ qName, {autoDelete: false, durable: true, 'arguments': {'x-expires': 301}}, function() {
puts("second queue declared");
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment