Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #9823 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

[PATCH] Fix for MemCacheStore initialization

Reported by: kamk Assigned to: nzkoz
Priority: normal Milestone: 2.x
Component: ActionPack Version: edge
Severity: normal Keywords:
Cc:

Description

Calling MemCache#add to satisfy protocol of usage of memcache server. Removed silent discards of exceptions. Added unit test MemCacheStoreTest.

Attachments

mem_cache_store_fixed_session_initialization.diff (5.3 kB) - added by kamk on 10/08/07 20:31:19.
mem_cache_store_test.rb (4.7 kB) - added by kamk on 10/14/07 20:03:27.

Change History

10/08/07 20:31:19 changed by kamk

  • attachment mem_cache_store_fixed_session_initialization.diff added.

10/13/07 03:21:55 changed by nzkoz

  • owner changed from core to nzkoz.
  • status changed from new to assigned.

The fix looks good, but the tests are a little strange.

Wouldn't it be possible to use mocha to make sure the mem cache store is interacting with the client library correctly? providing a Mock as options[:cache] should work?

10/14/07 20:02:25 changed by kamk

Hm, I haven't used mocha yet, but I've tried to adapt tests for it. In fact, now the test case is dual - when memcache is not available, the mock is used (as optionscache?) and all the tests are performed. Attached file mem_cache_store_test.rb

10/14/07 20:03:27 changed by kamk

  • attachment mem_cache_store_test.rb added.

10/14/07 20:46:10 changed by bitsweat

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [7885]) Memcached sessions: add session data on initialization; don't silently discard exceptions; add unit tests. Closes #9823.