FIX: Remove trailing comma incorrectly added in ec60d8865.

FIX: Remove trailing comma incorrectly added in ec60d8865.

Also added test to prevent this regression.

diff --git a/lib/message_bus.rb b/lib/message_bus.rb
index ce5bf28..364a0b7 100644
--- a/lib/message_bus.rb
+++ b/lib/message_bus.rb
@@ -369,7 +369,7 @@ module MessageBus::Implementation
 
     if opts
       if ((age = opts[:max_backlog_age]) || (size = opts[:max_backlog_size]))
-        channel_opts[:max_backlog_size] = size,
+        channel_opts[:max_backlog_size] = size
         channel_opts[:max_backlog_age] = age
       end
 
diff --git a/spec/lib/message_bus_spec.rb b/spec/lib/message_bus_spec.rb
index d63af5e..df923d9 100644
--- a/spec/lib/message_bus_spec.rb
+++ b/spec/lib/message_bus_spec.rb
@@ -201,6 +201,13 @@ describe MessageBus do
     @bus.backlog("/chuck").map { |i| i.data }.to_a.must_equal ['norris', 'foo']
   end
 
+  it "should correctly restrict the backlog size of a channel" do
+    @bus.publish("/chuck", "norris")
+    @bus.publish("/chuck", "foo", max_backlog_size: 1)
+
+    @bus.backlog("/chuck").map { |i| i.data }.to_a.must_equal ['foo']
+  end
+
   it "allows you to look up last_message" do
     @bus.publish("/bob", "dylan")
     @bus.publish("/bob", "marley")

GitHub sha: 6b8305d6