memcached 0.16.3 → 0.17

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,25 +16,29 @@ class MemcachedTest < Test::Unit::TestCase
16
16
  @options = {
17
17
  :prefix_key => @prefix_key,
18
18
  :hash => :default,
19
- :distribution => :modula
20
- }
19
+ :distribution => :modula}
21
20
  @cache = Memcached.new(@servers, @options)
21
+
22
+ @binary_protocol_options = {
23
+ :prefix_key => @prefix_key,
24
+ :hash => :default,
25
+ :distribution => :modula,
26
+ :binary_protocol => true}
27
+ @binary_protocol_cache = Memcached.new(@servers, @binary_protocol_options)
22
28
 
23
29
  @udp_options = {
24
30
  :prefix_key => @prefix_key,
25
31
  :hash => :default,
26
32
  :use_udp => true,
27
- :distribution => :modula
28
- }
33
+ :distribution => :modula}
29
34
  @udp_cache = Memcached.new(@udp_servers, @udp_options)
30
35
 
31
- @nb_options = {
36
+ @noblock_options = {
32
37
  :prefix_key => @prefix_key,
33
38
  :no_block => true,
34
39
  :buffer_requests => true,
35
- :hash => :default
36
- }
37
- @nb_cache = Memcached.new(@servers, @nb_options)
40
+ :hash => :default}
41
+ @noblock_cache = Memcached.new(@servers, @noblock_options)
38
42
 
39
43
  @value = OpenStruct.new(:a => 1, :b => 2, :c => GenericClass)
40
44
  @marshalled_value = Marshal.dump(@value)
@@ -85,8 +89,8 @@ class MemcachedTest < Test::Unit::TestCase
85
89
  end
86
90
 
87
91
  def test_options_are_set
88
- Memcached::DEFAULTS.merge(@nb_options).each do |key, expected|
89
- value = @nb_cache.options[key]
92
+ Memcached::DEFAULTS.merge(@noblock_options).each do |key, expected|
93
+ value = @noblock_cache.options[key]
90
94
  unless key == :rcv_timeout or key == :poll_timeout
91
95
  assert(expected == value, "#{key} should be #{expected} but was #{value}")
92
96
  end
@@ -111,15 +115,6 @@ class MemcachedTest < Test::Unit::TestCase
111
115
  assert_raise(ArgumentError) { Memcached.new "local host:43043:1" }
112
116
  end
113
117
 
114
- # def test_initialize_with_resolvable_hosts
115
- # host = `hostname`.chomp
116
- # cache = Memcached.new("#{host}:43042")
117
- # assert_equal host, cache.send(:server_structs).first.hostname
118
- #
119
- # cache.set(key, @value)
120
- # assert_equal @value, cache.get(key)
121
- # end
122
-
123
118
  def test_initialize_with_invalid_options
124
119
  assert_raise(ArgumentError) do
125
120
  Memcached.new @servers, :sort_hosts => true, :distribution => :consistent
@@ -223,9 +218,11 @@ class MemcachedTest < Test::Unit::TestCase
223
218
  @cache.set key, @value
224
219
  result = @cache.get key
225
220
  assert_equal @value, result
226
- end
227
221
 
228
- def test_udp_get
222
+ @binary_protocol_cache.set key, @value
223
+ result = @binary_protocol_cache.get key
224
+ assert_equal @value, result
225
+
229
226
  @udp_cache.set(key, @value)
230
227
  assert_raises(Memcached::ActionNotSupported) do
231
228
  @udp_cache.get(key)
@@ -410,9 +407,11 @@ class MemcachedTest < Test::Unit::TestCase
410
407
  assert_nothing_raised do
411
408
  @cache.set(key, @value)
412
409
  end
413
- end
410
+
411
+ assert_nothing_raised do
412
+ @binary_protocol_cache.set(key, @value)
413
+ end
414
414
 
415
- def test_udp_set
416
415
  assert_nothing_raised do
417
416
  @udp_cache.set(key, @value)
418
417
  end
@@ -571,6 +570,12 @@ class MemcachedTest < Test::Unit::TestCase
571
570
  @cache.append key, "end"
572
571
  end
573
572
  assert_equal "startend", @cache.get(key, false)
573
+
574
+ @binary_protocol_cache.set key, "start", 0, false
575
+ assert_nothing_raised do
576
+ @binary_protocol_cache.append key, "end"
577
+ end
578
+ assert_equal "startend", @binary_protocol_cache.get(key, false)
574
579
  end
575
580
 
576
581
  def test_missing_append
@@ -581,6 +586,14 @@ class MemcachedTest < Test::Unit::TestCase
581
586
  assert_raise(Memcached::NotFound) do
582
587
  assert_equal @value, @cache.get(key)
583
588
  end
589
+
590
+ @binary_protocol_cache.delete key rescue nil
591
+ assert_raise(Memcached::NotStored) do
592
+ @binary_protocol_cache.append key, "end"
593
+ end
594
+ assert_raise(Memcached::NotFound) do
595
+ assert_equal @value, @binary_protocol_cache.get(key)
596
+ end
584
597
  end
585
598
 
586
599
  def test_prepend
@@ -753,10 +766,10 @@ class MemcachedTest < Test::Unit::TestCase
753
766
 
754
767
  def test_no_block_return_value
755
768
  assert_nothing_raised do
756
- @nb_cache.set key, @value
769
+ @noblock_cache.set key, @value
757
770
  end
758
771
  ret = Rlibmemcached.memcached_set(
759
- @nb_cache.instance_variable_get("@struct"),
772
+ @noblock_cache.instance_variable_get("@struct"),
760
773
  key,
761
774
  @marshalled_value,
762
775
  0,
@@ -766,35 +779,35 @@ class MemcachedTest < Test::Unit::TestCase
766
779
  end
767
780
 
768
781
  def test_no_block_get
769
- @nb_cache.set key, @value
782
+ @noblock_cache.set key, @value
770
783
  assert_equal @value,
771
- @nb_cache.get(key)
784
+ @noblock_cache.get(key)
772
785
  end
773
786
 
774
787
  def test_no_block_missing_delete
775
- @nb_cache.delete key rescue nil
788
+ @noblock_cache.delete key rescue nil
776
789
  assert_nothing_raised do
777
- @nb_cache.delete key
790
+ @noblock_cache.delete key
778
791
  end
779
792
  end
780
793
 
781
794
  def test_no_block_set_invalid_key
782
795
  assert_raises(Memcached::ABadKeyWasProvidedOrCharactersOutOfRange) do
783
- @nb_cache.set "I'm so bad", @value
796
+ @noblock_cache.set "I'm so bad", @value
784
797
  end
785
798
  end
786
799
 
787
800
  def test_no_block_set_object_too_large
788
801
  assert_nothing_raised do
789
- @nb_cache.set key, "I'm big" * 1000000
802
+ @noblock_cache.set key, "I'm big" * 1000000
790
803
  end
791
804
  end
792
805
 
793
806
  def test_no_block_existing_add
794
807
  # Should still raise
795
- @nb_cache.set key, @value
808
+ @noblock_cache.set key, @value
796
809
  assert_raise(Memcached::NotStored) do
797
- @nb_cache.add key, @value
810
+ @noblock_cache.add key, @value
798
811
  end
799
812
  end
800
813
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: memcached
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.3
4
+ version: "0.17"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Weaver
@@ -30,7 +30,7 @@ cert_chain:
30
30
  yZ0=
31
31
  -----END CERTIFICATE-----
32
32
 
33
- date: 2009-09-04 00:00:00 -07:00
33
+ date: 2009-09-21 00:00:00 -07:00
34
34
  default_executable:
35
35
  dependencies: []
36
36
 
@@ -43,33 +43,33 @@ extensions:
43
43
  extra_rdoc_files:
44
44
  - BENCHMARKS
45
45
  - CHANGELOG
46
- - COMPATIBILITY
46
+ - LICENSE
47
+ - README
48
+ - TODO
49
+ - lib/memcached.rb
47
50
  - lib/memcached/behaviors.rb
48
51
  - lib/memcached/exceptions.rb
49
52
  - lib/memcached/memcached.rb
50
53
  - lib/memcached/rails.rb
51
- - lib/memcached.rb
52
- - LICENSE
53
- - README
54
- - TODO
55
54
  files:
56
55
  - BENCHMARKS
57
56
  - CHANGELOG
58
- - COMPATIBILITY
57
+ - LICENSE
58
+ - Manifest
59
+ - README
60
+ - Rakefile
61
+ - TODO
59
62
  - ext/extconf.rb
60
- - ext/libmemcached-0.31.tar.gz
63
+ - ext/libmemcached-0.32.tar.gz
64
+ - ext/libmemcached.patch
61
65
  - ext/rlibmemcached.i
62
66
  - ext/rlibmemcached_wrap.c
67
+ - lib/memcached.rb
63
68
  - lib/memcached/behaviors.rb
64
69
  - lib/memcached/exceptions.rb
65
70
  - lib/memcached/integer.rb
66
71
  - lib/memcached/memcached.rb
67
72
  - lib/memcached/rails.rb
68
- - lib/memcached.rb
69
- - LICENSE
70
- - Manifest
71
- - Rakefile
72
- - README
73
73
  - test/profile/benchmark.rb
74
74
  - test/profile/profile.rb
75
75
  - test/profile/valgrind.rb
@@ -79,7 +79,6 @@ files:
79
79
  - test/unit/binding_test.rb
80
80
  - test/unit/memcached_test.rb
81
81
  - test/unit/rails_test.rb
82
- - TODO
83
82
  - memcached.gemspec
84
83
  has_rdoc: true
85
84
  homepage: http://blog.evanweaver.com/files/doc/fauna/memcached/
metadata.gz.sig CHANGED
@@ -1,2 +1 @@
1
- RKy��e������[�<R��
2
- R�u��#�1����d�D %$ ����T��\€t��ሤ�4$����0&j��7����AV8��| �ΜOv��m�}���?��^e���'bd�d�V��T�ɨ�頸���� (98���"�� �Ƀf )�O�E���{��� ��;|�߹E��X65�F5����
1
+ ����4ɫ��A;�����hW,2� ��)�W�k� Q��-�����̨]� zA9:f$��O H�̛.�3
@@ -1,17 +0,0 @@
1
-
2
- == Compatibility chart
3
-
4
- This chart shows which versions of the Ruby library are compatible with which versions of libmemcached.
5
-
6
- <b>Library version</b>:: <b>libmemcached version</b>
7
- 0.15:: 0.31
8
- 0.14.4:: 0.26.3
9
- 0.13:: 0.25
10
- 0.12:: 0.24
11
- 0.11:: 0.22
12
- 0.10:: 0.20
13
- 0.9:: 0.19
14
- 0.8:: 0.16
15
- 0.7:: 0.15
16
- 0.6:: 0.13
17
- 0.5:: 0.13
Binary file