@@ -1,6 +1,13 @@
Revision history for Test-Net-RabbitMQ
+0.11 Nov 20 2014
+ * Calling queue_declare would wipe out the contents of the queue if it
+ already existed. (Dave Rolsky)
+
0.10 Oct 11 2014
+ * Message properties now default to an empty hash if none are
+ specified. This matches the behavior of Net::AMQP::RabbitMQ. (Dave
+ Rolsky)
0.09 Jun 30 2012
* Add tx_select, tx_commit, and tx_rollback support. (bluefeet)
@@ -14,6 +14,7 @@ t/channels.t
t/connections.t
t/fifo.t
t/pubsub.t
+t/queue.t
t/release-pod-syntax.t
t/release-synopsis.t
t/simple.t
@@ -50,6 +50,6 @@
"web" : "https://github.com/gphat/test-net-rabbitmq"
}
},
- "version" : "0.10"
+ "version" : "0.11"
}
@@ -22,4 +22,4 @@ resources:
bugtracker: https://github.com/gphat/test-net-rabbitmq/issues
homepage: https://github.com/gphat/test-net-rabbitmq
repository: https://github.com/gphat/test-net-rabbitmq.git
-version: 0.10
+version: 0.11
@@ -29,7 +29,7 @@ my %WriteMakefileArgs = (
"Test::Exception" => 0,
"Test::More" => 0
},
- "VERSION" => "0.10",
+ "VERSION" => "0.11",
"test" => {
"TESTS" => "t/*.t"
}
@@ -1,7 +1,7 @@
This archive contains the distribution Test-Net-RabbitMQ,
-version 0.10:
+version 0.11:
A mock RabbitMQ implementation for use when testing.
@@ -4,7 +4,7 @@ Test::Net::RabbitMQ - A mock RabbitMQ implementation for use when testing.
# VERSION
-version 0.10
+version 0.11
# SYNOPSIS
@@ -1,5 +1,5 @@
package Test::Net::RabbitMQ;
-$Test::Net::RabbitMQ::VERSION = '0.10';
+$Test::Net::RabbitMQ::VERSION = '0.11';
use Moose;
use warnings;
use strict;
@@ -284,7 +284,7 @@ sub queue_declare {
die "Unknown channel: $channel" unless $self->_channel_exists($channel);
- $self->_set_queue($queue, []);
+ $self->_set_queue($queue, []) unless $self->_queue_exists($queue);
}
@@ -398,7 +398,7 @@ Test::Net::RabbitMQ - A mock RabbitMQ implementation for use when testing.
=head1 VERSION
-version 0.10
+version 0.11
=head1 SYNOPSIS
@@ -0,0 +1,27 @@
+use Test::More;
+use Test::Exception;
+
+use Test::Net::RabbitMQ;
+
+my $mq = Test::Net::RabbitMQ->new;
+isa_ok($mq, 'Test::Net::RabbitMQ', 'instantiated');
+
+$mq->connect;
+
+$mq->channel_open(1);
+
+$mq->exchange_declare(1, 'ex');
+$mq->queue_declare(1, 'bind-twice');
+$mq->queue_bind(1, 'bind-twice', 'ex', 'key');
+$mq->publish(
+ 1, 'key', 'message body',
+ { exchange => 'ex' },
+ { content_type => 'text/plain' }
+);
+$mq->queue_declare(1, 'bind-twice');
+
+my $msg = $mq->get(1, 'bind-twice');
+ok($msg, 'got message after calling queue_declare');
+is($msg->{body}, 'message body', 'message body contains expected content');
+
+done_testing;