beetle 0.3.0.rc.16 → 0.3.0.rc.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/beetle/client.rb CHANGED
@@ -299,6 +299,10 @@ module Beetle
299
299
  options = @options.merge(args.last.is_a?(Hash) ? args.pop : {})
300
300
  @client.send("register_#{method}", *(args+[options]), &block)
301
301
  end
302
+ # need to override binding explicitely
303
+ def binding(*args, &block)
304
+ method_missing(:binding, *args, &block)
305
+ end
302
306
  end
303
307
 
304
308
  def publisher
@@ -1,3 +1,3 @@
1
1
  module Beetle
2
- VERSION = "0.3.0.rc.16"
2
+ VERSION = "0.3.0.rc.17"
3
3
  end
@@ -181,6 +181,26 @@ module Beetle
181
181
 
182
182
  assert_raises(NoMethodError){ config.moo }
183
183
  end
184
+
185
+ test "a configurator should forward all known registration methods to the client (no arguments block syntax)" do
186
+ options = {:foo => :bar}
187
+ config = Client::Configurator.new(@client, options)
188
+ @client.expects(:register_exchange).with(:a, options)
189
+ @client.expects(:register_queue).with(:q, options.merge(:exchange => :foo))
190
+ @client.expects(:register_binding).with(:b, options.merge(:key => :baz))
191
+ @client.expects(:register_message).with(:m, options.merge(:exchange => :foo))
192
+ @client.expects(:register_handler).with(:h, options.merge(:queue => :q))
193
+ @client.configure(options) do
194
+ exchange(:a)
195
+ queue(:q, :exchange => :foo)
196
+ binding(:b, :key => :baz)
197
+ message(:m, :exchange => :foo)
198
+ handler(:h, :queue => :q)
199
+ end
200
+
201
+ assert_raises(NoMethodError){ @client.configure{moo(3)} }
202
+ end
203
+
184
204
  end
185
205
 
186
206
  class ClientTest < Test::Unit::TestCase
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beetle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0.rc.16
4
+ version: 0.3.0.rc.17
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2012-11-20 00:00:00.000000000 Z
16
+ date: 2012-11-21 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: uuid4r
@@ -276,7 +276,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
276
276
  version: '0'
277
277
  segments:
278
278
  - 0
279
- hash: -3446454574049422431
279
+ hash: -36003570872479659
280
280
  required_rubygems_version: !ruby/object:Gem::Requirement
281
281
  none: false
282
282
  requirements: