diff options
author | Joshua Peek <josh@joshpeek.com> | 2008-08-13 20:57:26 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-08-13 20:57:26 -0500 |
commit | b8b30985d525fd15b6c16d29fc115e83e3ee5037 (patch) | |
tree | a0d4c18494722ce2eb1f1dc6b1c05781f1a6c28d /activesupport/test | |
parent | c7e09a8fb234d80f06fcd70b9263e28e42c4378b (diff) | |
download | rails-b8b30985d525fd15b6c16d29fc115e83e3ee5037.tar.gz rails-b8b30985d525fd15b6c16d29fc115e83e3ee5037.tar.bz2 rails-b8b30985d525fd15b6c16d29fc115e83e3ee5037.zip |
Marshal FileStore values
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/caching_test.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb index f3220d27aa..c5f7fb7fdd 100644 --- a/activesupport/test/caching_test.rb +++ b/activesupport/test/caching_test.rb @@ -70,3 +70,30 @@ uses_mocha 'high-level cache store tests' do end end end + +class FileStoreTest < Test::Unit::TestCase + def setup + @cache = ActiveSupport::Cache.lookup_store(:file_store, Dir.pwd) + end + + def test_should_read_and_write_strings + @cache.write('foo', 'bar') + assert_equal 'bar', @cache.read('foo') + ensure + File.delete("foo.cache") + end + + def test_should_read_and_write_hash + @cache.write('foo', {:a => "b"}) + assert_equal({:a => "b"}, @cache.read('foo')) + ensure + File.delete("foo.cache") + end + + def test_should_read_and_write_nil + @cache.write('foo', nil) + assert_equal nil, @cache.read('foo') + ensure + File.delete("foo.cache") + end +end |