fake_smith 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/fake_smith/version.rb +1 -1
- data/lib/fake_smith.rb +8 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbb42aa79f19cb7b81bcd0edb8ea889479bf0019
|
4
|
+
data.tar.gz: 2be958a2c307267313943529e40035544edcb429
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aec9057db360d3454d58cefa68fde67ab617395f4a0dba088365c0e13b2c894554aceed4ced4657b493f05dac6d430a1f88981f78cebc448a1c0af1fa64871a9
|
7
|
+
data.tar.gz: 6d35c8ea28362f8e5af6bccb39d728314fed88bedbe26091028d2e93a5e1e577a113ea265e260bdaf2846d5c84162273bced4379a79f81fee45f391eb9492365
|
data/README.md
CHANGED
@@ -30,7 +30,7 @@ In your spec_helper or in your spec simply:
|
|
30
30
|
require 'fake_smith'
|
31
31
|
```
|
32
32
|
|
33
|
-
This will stub out all smith methods so you are free to test your agents without even
|
33
|
+
This will stub out all smith methods so you are free to test your agents without even starting EventMachine (though you may need to if you agent depends on EventMachine stuff)
|
34
34
|
|
35
35
|
To start your agent:
|
36
36
|
|
data/lib/fake_smith/version.rb
CHANGED
data/lib/fake_smith.rb
CHANGED
@@ -2,6 +2,7 @@ require "fake_smith/version"
|
|
2
2
|
|
3
3
|
class FakeSmith
|
4
4
|
def self.send_message(queue_name, payload, receiver)
|
5
|
+
raise "no subscribers on queue: #{queue_name}" unless subscriptions[queue_name]
|
5
6
|
subscriptions[queue_name].call(payload, receiver)
|
6
7
|
end
|
7
8
|
|
@@ -73,6 +74,10 @@ module Smith
|
|
73
74
|
def subscribe(&blk)
|
74
75
|
FakeSmith.define_subscription(@queue_name, &blk)
|
75
76
|
end
|
77
|
+
|
78
|
+
def requeue_parameters(opts)
|
79
|
+
@requeue_opts = opts
|
80
|
+
end
|
76
81
|
end
|
77
82
|
end
|
78
83
|
end
|
@@ -108,7 +113,9 @@ module Smith
|
|
108
113
|
end
|
109
114
|
|
110
115
|
def receiver(queue_name, opts={}, &blk)
|
111
|
-
Smith::Messaging::Receiver.new(queue_name, opts, &blk)
|
116
|
+
r = Smith::Messaging::Receiver.new(queue_name, opts, &blk)
|
117
|
+
blk.call r
|
118
|
+
r
|
112
119
|
end
|
113
120
|
|
114
121
|
def sender(queue_name, opts={}, &blk)
|