forked from nateware/redis-objects
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathredis_autoload_objects_spec.rb
46 lines (36 loc) · 1.36 KB
/
redis_autoload_objects_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
43
44
45
46
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
# tests whether autoload functionality works correctly; had issues previously
require 'redis/objects'
# $redis used automatically
describe 'Redis::Objects' do
it "should autoload everything" do
defined?(::Redis::Counter).should == "constant"
x = Redis::Counter.new('x')
x.class.name.should == "Redis::Counter"
x.redis.should == REDIS_HANDLE
defined?(::Redis::HashKey).should == "constant"
x = Redis::HashKey.new('x')
x.class.name.should == "Redis::HashKey"
x.redis.should == REDIS_HANDLE
defined?(::Redis::List).should == "constant"
x = Redis::List.new('x')
x.class.name.should == "Redis::List"
x.redis.should == REDIS_HANDLE
defined?(::Redis::Lock).should == "constant"
x = Redis::Lock.new('x')
x.class.name.should == "Redis::Lock"
x.redis.should == REDIS_HANDLE
defined?(::Redis::Set).should == "constant"
x = Redis::Set.new('x')
x.class.name.should == "Redis::Set"
x.redis.should == REDIS_HANDLE
defined?(::Redis::SortedSet).should == "constant"
x = Redis::SortedSet.new('x')
x.class.name.should == "Redis::SortedSet"
x.redis.should == REDIS_HANDLE
defined?(::Redis::Value).should == "constant"
x = Redis::Value.new('x')
x.class.name.should == "Redis::Value"
x.redis.should == REDIS_HANDLE
end
end