lolitra 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,2 @@
1
1
  require "lolitra/version"
2
2
  require "lolitra/handler_base"
3
- require "lolitra/future"
@@ -1,3 +1,3 @@
1
1
  module Lolitra
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -71,8 +71,13 @@ class TestMessageHandlerAmqp1
71
71
  include Lolitra::MessageHandler
72
72
 
73
73
  message_handler TestMessage
74
+ message_handler TestMessage1
74
75
 
75
76
  stateful false
77
+
78
+ def test_message(message)
79
+ "handled"
80
+ end
76
81
  end
77
82
 
78
83
  describe Lolitra::MessageHandler,'#create_handler' do
@@ -121,7 +126,7 @@ describe Lolitra::MessageHandler, '#publish' do
121
126
 
122
127
 
123
128
  TestMessageHandler.should_receive(:handle).with(message)
124
- TestMessageHandler.publish(message)
129
+ TestMessageHandler.publish message
125
130
  end
126
131
  end
127
132
 
@@ -206,6 +211,8 @@ end
206
211
 
207
212
  describe Lolitra::AmqpBus do
208
213
  it "should send all messages to all subscribers in non pull mode" do
214
+ EM.run
215
+
209
216
  Lolitra::MessageHandlerManager.bus = Lolitra::AmqpBus.new(:host => "127.0.0.1", :exchange => "test_exchange")
210
217
  Lolitra::MessageHandlerManager.register_subscriber(TestMessageHandlerAmqp)
211
218
  Lolitra::MessageHandlerManager.register_subscriber(TestMessageHandlerAmqp1)
@@ -213,6 +220,7 @@ describe Lolitra::AmqpBus do
213
220
  @handled_message_1 = false
214
221
  @handled_message_2 = false
215
222
 
223
+
216
224
  TestMessageHandlerAmqp.should_receive(:handle) do |message|
217
225
  message.should be_an_instance_of TestMessage
218
226
  @handled_message_1 = true
@@ -234,14 +242,3 @@ describe Lolitra::AmqpBus do
234
242
  end
235
243
  end
236
244
 
237
- describe Lolitra::Future,"#wait_message" do
238
- it "should return the message" do
239
- Lolitra::MessageHandlerManager.bus = Lolitra::AmqpBus.new(:host => "127.0.0.1", :exchange => "test_exchange")
240
- EM.next_tick{
241
- Lolitra::MessageHandlerManager.publish(TestMessage.new)
242
- }
243
- future = Lolitra::Future.new
244
- message = future.wait_for(TestMessage)
245
- message.should be_an_instance_of TestMessage
246
- end
247
- end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 4
9
- version: 0.0.4
8
+ - 5
9
+ version: 0.0.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Hugo Freire
@@ -75,7 +75,6 @@ files:
75
75
  - lib/lolitra.rb
76
76
  - lib/lolitra/.future.rb.swp
77
77
  - lib/lolitra/.handler_base.rb.swp
78
- - lib/lolitra/future.rb
79
78
  - lib/lolitra/handler_base.rb
80
79
  - lib/lolitra/version.rb
81
80
  - lolitra.gemspec
@@ -1,7 +0,0 @@
1
- module Lolitra
2
- class Future
3
- def initialze(message_class)
4
-
5
- end
6
- end
7
- end