mongo 1.8.4 → 1.8.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +6 -14
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/README.md +2 -0
- data/VERSION +1 -1
- data/lib/mongo.rb +11 -9
- data/lib/mongo/collection.rb +26 -19
- data/lib/mongo/cursor.rb +7 -2
- data/lib/mongo/db.rb +1 -1
- data/lib/mongo/mongo_client.rb +1 -1
- data/lib/mongo/mongo_replica_set_client.rb +2 -3
- data/lib/mongo/mongo_sharded_client.rb +1 -2
- data/lib/mongo/util/node.rb +12 -14
- data/lib/mongo/util/pool.rb +1 -1
- data/lib/mongo/util/pool_manager.rb +13 -15
- data/lib/mongo/util/sharding_pool_manager.rb +5 -2
- data/lib/mongo/util/support.rb +14 -0
- data/mongo.gemspec +7 -3
- data/test/functional/authentication_test.rb +21 -0
- data/test/functional/collection_test.rb +0 -1
- data/test/functional/connection_test.rb +1 -1
- data/test/functional/db_test.rb +1 -56
- data/test/functional/support_test.rb +30 -0
- data/test/replica_set/authentication_test.rb +23 -0
- data/test/replica_set/max_values_test.rb +61 -0
- data/test/sharded_cluster/basic_test.rb +18 -0
- data/test/shared/authentication.rb +49 -0
- data/test/tools/mongo_config.rb +21 -26
- data/test/unit/node_test.rb +3 -0
- data/test/unit/pool_manager_test.rb +3 -1
- data/test/unit/read_test.rb +4 -0
- data/test/unit/sharding_pool_manager_test.rb +88 -0
- metadata +38 -69
- metadata.gz.sig +0 -0
- data/test/auxillary/1.4_feature_test.rb +0 -165
- data/test/auxillary/authentication_test.rb +0 -74
- data/test/auxillary/autoreconnect_test.rb +0 -39
- data/test/auxillary/fork_test.rb +0 -28
- data/test/auxillary/pool_reuse_test.rb +0 -65
- data/test/auxillary/repl_set_auth_test.rb +0 -69
- data/test/auxillary/slave_connection_test.rb +0 -37
- data/test/auxillary/threaded_authentication_test.rb +0 -99
- data/test/bson/binary_test.rb +0 -13
- data/test/bson/bson_test.rb +0 -762
- data/test/bson/byte_buffer_test.rb +0 -215
- data/test/bson/hash_with_indifferent_access_test.rb +0 -48
- data/test/bson/json_test.rb +0 -16
- data/test/bson/object_id_test.rb +0 -153
- data/test/bson/ordered_hash_test.rb +0 -247
- data/test/bson/timestamp_test.rb +0 -51
- data/test/tools/auth_repl_set_manager.rb +0 -14
data/test/bson/timestamp_test.rb
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class TimestampTest < Test::Unit::TestCase
|
4
|
-
|
5
|
-
def test_timestamp_to_s
|
6
|
-
t1 = Timestamp.new(5000, 200)
|
7
|
-
assert_equal "seconds: 5000, increment: 200", t1.to_s
|
8
|
-
end
|
9
|
-
|
10
|
-
def test_timestamp_equality
|
11
|
-
t1 = Timestamp.new(5000, 200)
|
12
|
-
t2 = Timestamp.new(5000, 200)
|
13
|
-
assert_equal t2, t1
|
14
|
-
end
|
15
|
-
|
16
|
-
def test_timestamp_range
|
17
|
-
t = 1;
|
18
|
-
while(t < 1_000_000_000 ) do
|
19
|
-
ts = Timestamp.new(t, 0)
|
20
|
-
doc = {:ts => ts}
|
21
|
-
bson = BSON::BSON_CODER.serialize(doc)
|
22
|
-
assert_equal doc[:ts], BSON::BSON_CODER.deserialize(bson)['ts']
|
23
|
-
t = t * 10
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_timestamp_32bit_compatibility
|
28
|
-
max_32bit_fixnum = (1 << 30) - 1
|
29
|
-
test_val = max_32bit_fixnum + 10
|
30
|
-
|
31
|
-
ts = Timestamp.new(test_val, test_val)
|
32
|
-
doc = {:ts => ts}
|
33
|
-
bson = BSON::BSON_CODER.serialize(doc)
|
34
|
-
assert_equal doc[:ts], BSON::BSON_CODER.deserialize(bson)['ts']
|
35
|
-
end
|
36
|
-
|
37
|
-
def test_implements_array_for_backward_compatibility
|
38
|
-
silently do
|
39
|
-
ts = Timestamp.new(5000, 200)
|
40
|
-
assert_equal 200, ts[0]
|
41
|
-
assert_equal 5000, ts[1]
|
42
|
-
|
43
|
-
array = ts.map {|t| t }
|
44
|
-
assert_equal 2, array.length
|
45
|
-
|
46
|
-
assert_equal 200, array[0]
|
47
|
-
assert_equal 5000, array[1]
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
require File.join((File.expand_path(File.dirname(__FILE__))), 'repl_set_manager')
|
2
|
-
|
3
|
-
class AuthReplSetManager < ReplSetManager
|
4
|
-
def initialize(opts={})
|
5
|
-
super(opts)
|
6
|
-
|
7
|
-
@key_path = opts[:key_path] || File.join(File.expand_path(File.dirname(__FILE__)), "keyfile.txt")
|
8
|
-
system("chmod 600 #{@key_path}")
|
9
|
-
end
|
10
|
-
|
11
|
-
def start_cmd(n)
|
12
|
-
super + " --keyFile #{@key_path}"
|
13
|
-
end
|
14
|
-
end
|