Sha256: dbd2a0cff324657c81cf87e1e393ba882efcd898c348e7be4aaa18d04d4395ed
Contents?: true
Size: 805 Bytes
Versions: 2
Compression:
Stored size: 805 Bytes
Contents
require 'spec_helper' describe MethodCacheable::MethodCache do before(:all) do @user = User.new end before(:each) do @uniq ||= 0 @uniq += 1 end describe 'initialize' do it 'saves caller' do @user.cache.caller_object.should eq(@user) end it 'saves cache_method' do cache_method = :fetch @user.cache(cache_method).cache_operation.should eq(cache_method) end it 'saves options' do options = {:foo => "bar"} @user.cache(options).options.should eq(options) end it 'saves options and cache_method' do cache_method = :write options = {:foo => "bar"} cache = @user.cache(cache_method, options) cache.options.should eq(options) cache.cache_operation.should eq(cache_method) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
method_cacheable-0.0.3 | spec/method_cacheable/method_cache_spec.rb |
method_cacheable-0.0.2 | spec/method_cacheable/method_cache_spec.rb |