mongo 1.8.4 → 1.8.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +6 -14
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/README.md +2 -0
  5. data/VERSION +1 -1
  6. data/lib/mongo.rb +11 -9
  7. data/lib/mongo/collection.rb +26 -19
  8. data/lib/mongo/cursor.rb +7 -2
  9. data/lib/mongo/db.rb +1 -1
  10. data/lib/mongo/mongo_client.rb +1 -1
  11. data/lib/mongo/mongo_replica_set_client.rb +2 -3
  12. data/lib/mongo/mongo_sharded_client.rb +1 -2
  13. data/lib/mongo/util/node.rb +12 -14
  14. data/lib/mongo/util/pool.rb +1 -1
  15. data/lib/mongo/util/pool_manager.rb +13 -15
  16. data/lib/mongo/util/sharding_pool_manager.rb +5 -2
  17. data/lib/mongo/util/support.rb +14 -0
  18. data/mongo.gemspec +7 -3
  19. data/test/functional/authentication_test.rb +21 -0
  20. data/test/functional/collection_test.rb +0 -1
  21. data/test/functional/connection_test.rb +1 -1
  22. data/test/functional/db_test.rb +1 -56
  23. data/test/functional/support_test.rb +30 -0
  24. data/test/replica_set/authentication_test.rb +23 -0
  25. data/test/replica_set/max_values_test.rb +61 -0
  26. data/test/sharded_cluster/basic_test.rb +18 -0
  27. data/test/shared/authentication.rb +49 -0
  28. data/test/tools/mongo_config.rb +21 -26
  29. data/test/unit/node_test.rb +3 -0
  30. data/test/unit/pool_manager_test.rb +3 -1
  31. data/test/unit/read_test.rb +4 -0
  32. data/test/unit/sharding_pool_manager_test.rb +88 -0
  33. metadata +38 -69
  34. metadata.gz.sig +0 -0
  35. data/test/auxillary/1.4_feature_test.rb +0 -165
  36. data/test/auxillary/authentication_test.rb +0 -74
  37. data/test/auxillary/autoreconnect_test.rb +0 -39
  38. data/test/auxillary/fork_test.rb +0 -28
  39. data/test/auxillary/pool_reuse_test.rb +0 -65
  40. data/test/auxillary/repl_set_auth_test.rb +0 -69
  41. data/test/auxillary/slave_connection_test.rb +0 -37
  42. data/test/auxillary/threaded_authentication_test.rb +0 -99
  43. data/test/bson/binary_test.rb +0 -13
  44. data/test/bson/bson_test.rb +0 -762
  45. data/test/bson/byte_buffer_test.rb +0 -215
  46. data/test/bson/hash_with_indifferent_access_test.rb +0 -48
  47. data/test/bson/json_test.rb +0 -16
  48. data/test/bson/object_id_test.rb +0 -153
  49. data/test/bson/ordered_hash_test.rb +0 -247
  50. data/test/bson/timestamp_test.rb +0 -51
  51. data/test/tools/auth_repl_set_manager.rb +0 -14
@@ -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