summaryrefslogtreecommitdiffstats
path: root/activesupport-remove-memcache-build-dep.patch
blob: 12b8c141997a2c1984fe2ad520f8bf061cfcb1cd (plain)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
--- test/abstract_unit.rb.orig	2011-02-02 12:38:56.766898240 -0500
+++ test/abstract_unit.rb	2011-02-02 12:38:55.397898289 -0500
@@ -34,12 +34,16 @@ require 'active_support'
 require 'active_support/ruby/shim' if RUBY_VERSION < '1.8.7'
 
 def uses_memcached(test_name)
-  require 'memcache'
   begin
-    MemCache.new('localhost:11211').stats
-    yield
-  rescue MemCache::MemCacheError
-    $stderr.puts "Skipping #{test_name} tests. Start memcached and try again."
+    require 'memcache'
+    begin
+      MemCache.new('localhost:11211').stats
+      yield
+    rescue MemCache::MemCacheError
+      $stderr.puts "Skipping #{test_name} tests. Start memcached and try again."
+    end
+  rescue LoadError
+    $stderr.puts "Skipping #{test_name} tests. Install memcache-client and try again."
   end
 end
 
--- test/caching_test.rb.orig	2011-02-02 12:39:05.979900964 -0500
+++ test/caching_test.rb	2011-02-02 12:41:10.089899015 -0500
@@ -59,40 +59,6 @@ class CacheStoreSettingTest < ActiveSupp
     assert_equal "/path/to/cache/directory", store.cache_path
   end
 
-  def test_mem_cache_fragment_cache_store
-    MemCache.expects(:new).with(%w[localhost], {})
-    store = ActiveSupport::Cache.lookup_store :mem_cache_store, "localhost"
-    assert_kind_of(ActiveSupport::Cache::MemCacheStore, store)
-  end
-
-  def test_mem_cache_fragment_cache_store_with_given_mem_cache
-    mem_cache = MemCache.new
-    MemCache.expects(:new).never
-    store = ActiveSupport::Cache.lookup_store :mem_cache_store, mem_cache
-    assert_kind_of(ActiveSupport::Cache::MemCacheStore, store)
-  end
-
-  def test_mem_cache_fragment_cache_store_with_given_mem_cache_like_object
-    MemCache.expects(:new).never
-    memcache = Object.new
-    def memcache.get() true end
-    store = ActiveSupport::Cache.lookup_store :mem_cache_store, memcache
-    assert_kind_of(ActiveSupport::Cache::MemCacheStore, store)
-  end
-
-  def test_mem_cache_fragment_cache_store_with_multiple_servers
-    MemCache.expects(:new).with(%w[localhost 192.168.1.1], {})
-    store = ActiveSupport::Cache.lookup_store :mem_cache_store, "localhost", '192.168.1.1'
-    assert_kind_of(ActiveSupport::Cache::MemCacheStore, store)
-  end
-
-  def test_mem_cache_fragment_cache_store_with_options
-    MemCache.expects(:new).with(%w[localhost 192.168.1.1], { :timeout => 10 })
-    store = ActiveSupport::Cache.lookup_store :mem_cache_store, "localhost", '192.168.1.1', :namespace => 'foo', :timeout => 10
-    assert_kind_of(ActiveSupport::Cache::MemCacheStore, store)
-    assert_equal 'foo', store.options[:namespace]
-  end
-
   def test_object_assigned_fragment_cache_store
     store = ActiveSupport::Cache.lookup_store ActiveSupport::Cache::FileStore.new("/path/to/cache/directory")
     assert_kind_of(ActiveSupport::Cache::FileStore, store)