-
Notifications
You must be signed in to change notification settings - Fork 151
/
remcached_spec.rb
42 lines (33 loc) · 940 Bytes
/
remcached_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
require "spec/helper/all"
require "remcached"
describe Memcached do
it "should yield until connection is ready" do
EventMachine.synchrony do
Memcached.connect %w(localhost)
Memcached.usable?.should eq(true)
EventMachine.stop
end
end
it "should fire sequential memcached requests" do
EventMachine.synchrony do
Memcached.connect %w(localhost)
Memcached.get(key: 'hai') do |res|
res[:value].should match('Not found')
end
Memcached.set(key: 'hai', value: 'win')
Memcached.add(key: 'count')
Memcached.delete(key: 'hai')
EventMachine.stop
end
end
it "should fire multi memcached requests" do
skip "patch mult-get"
EventMachine.synchrony do
Memcached.connect %w(localhost)
Memcached.multi_get([{:key => 'foo'},{:key => 'bar'}, {:key => 'test'}]) do |res|
# TODO
EventMachine.stop
end
end
end
end