@@ -3,30 +3,30 @@ def errmsg
3
3
"%s: %s\n %s" % [ self . class , message , ( backtrace || [ ] ) . join ( "\n " ) << "\n " ]
4
4
end
5
5
end
6
-
6
+
7
7
$LOAD_PATH[ 0 , 0 ] = File . join ( File . dirname ( __FILE__ ) , '..' , 'lib' )
8
8
require 'mongo'
9
9
10
- include XGen :: Mongo :: Driver
10
+ include Mongo
11
11
12
12
host = ENV [ 'MONGO_RUBY_DRIVER_HOST' ] || 'localhost'
13
- port = ENV [ 'MONGO_RUBY_DRIVER_PORT' ] || XGen :: Mongo :: Driver ::Mongo ::DEFAULT_PORT
13
+ port = ENV [ 'MONGO_RUBY_DRIVER_PORT' ] || Mongo ::Mongo ::DEFAULT_PORT
14
14
15
15
puts ">> Connecting to #{ host } :#{ port } "
16
- db = Mongo . new ( host , port ) . db ( 'ruby-mongo-index_test' )
16
+ db = Mongo :: Mongo . new ( host , port ) . db ( 'ruby-mongo-index_test' )
17
17
18
18
puts ">> Dropping collection test"
19
19
begin
20
20
res = db . drop_collection ( 'test' )
21
- puts "dropped : #{ res . inspect } "
21
+ puts "dropped : #{ res . inspect } "
22
22
rescue => e
23
23
puts "Error: #{ e . errmsg } "
24
24
end
25
25
26
26
puts ">> Creating collection test"
27
27
begin
28
28
coll = db . collection ( 'test' )
29
- puts "created : #{ coll . inspect } "
29
+ puts "created : #{ coll . inspect } "
30
30
rescue => e
31
31
puts "Error: #{ e . errmsg } "
32
32
end
@@ -59,8 +59,8 @@ def errmsg
59
59
60
60
puts ">> Gathering index information"
61
61
begin
62
- res = coll . index_information
63
- puts "index_information : #{ res . inspect } "
62
+ res = coll . index_information
63
+ puts "index_information : #{ res . inspect } "
64
64
rescue => e
65
65
puts "Error: #{ e . errmsg } "
66
66
end
@@ -76,7 +76,7 @@ def errmsg
76
76
77
77
puts ">> Dropping index"
78
78
begin
79
- res = coll . drop_index "all "
79
+ res = coll . drop_index "all_1 "
80
80
puts "dropped : #{ res . inspect } "
81
81
rescue => e
82
82
puts "Error: #{ e . errmsg } "
@@ -105,8 +105,8 @@ def errmsg
105
105
106
106
puts ">> Gathering index information"
107
107
begin
108
- res = coll . index_information
109
- puts "index_information : #{ res . inspect } "
108
+ res = coll . index_information
109
+ puts "index_information : #{ res . inspect } "
110
110
rescue => e
111
111
puts "Error: #{ e . errmsg } "
112
112
end
0 commit comments