aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/caching_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/caching_test.rb')
-rw-r--r--activesupport/test/caching_test.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb
index 892aa97ad7..00e05f76fe 100644
--- a/activesupport/test/caching_test.rb
+++ b/activesupport/test/caching_test.rb
@@ -30,7 +30,9 @@ class CacheStoreSettingTest < ActiveSupport::TestCase
def test_mem_cache_fragment_cache_store_with_given_mem_cache_like_object
MemCache.expects(:new).never
- store = ActiveSupport::Cache.lookup_store :mem_cache_store, stub("memcache", :get => true)
+ 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
@@ -154,13 +156,13 @@ class FileStoreTest < ActiveSupport::TestCase
File.stubs(:mtime).returns(time)
@cache.write('foo', 'bar')
- cache_read = lambda { @cache.read('foo', :expires_in => 1.minute) }
+ cache_read = lambda { @cache.read('foo', :expires_in => 60) }
assert_equal 'bar', cache_read.call
- Time.stubs(:now).returns(time + 30.seconds)
+ Time.stubs(:now).returns(time + 30)
assert_equal 'bar', cache_read.call
- Time.stubs(:now).returns(time + 2.minutes)
+ Time.stubs(:now).returns(time + 120)
assert_nil cache_read.call
end
end