Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Daniel Neighman
committed
Jun 22, 2008
1 parent
e925df5
commit 5c997f8
Showing
4 changed files
with
76 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,59 @@ | ||
require File.dirname(__FILE__) + '/spec_helper' | ||
|
||
# I refuse to spell initialisation with a z, this is me; taking it back for the rest of us. | ||
describe "merb-cache initialisation" do | ||
it "should default to memcached cache store" do | ||
@cache = Merb::Cache::Store.new | ||
@cache.config[:store].should eql(:memcached) | ||
end | ||
describe "Merb::Cache::Controller" do | ||
|
||
# I refuse to spell initialisation with a z, this is me; taking it back for the rest of us. | ||
describe "merb-cache initialisation" do | ||
it "should default to memcached cache store" do | ||
@cache = Merb::Cache::Store.new | ||
@cache.config[:store].should eql(:memcached) | ||
end | ||
|
||
it "should raise Merb::Cache:Store::NotFound for named cache stores that do not exist" do | ||
Merb::Plugins.config[:merb_cache] = { | ||
:store => 'fail' | ||
} | ||
lambda { Merb::Cache::Store.new }.should raise_error(Merb::Cache::Store::NotFound) | ||
end | ||
it "should raise Merb::Cache:Store::NotFound for named cache stores that do not exist" do | ||
Merb::Plugins.config[:merb_cache] = { | ||
:store => 'fail' | ||
} | ||
lambda { Merb::Cache::Store.new }.should raise_error(Merb::Cache::Store::NotFound) | ||
end | ||
|
||
it "should merge the default options when the default options are missing" do | ||
Merb::Plugins.config[:merb_cache] = { | ||
:fail => 'badconfigoptions' | ||
} | ||
it "should merge the default options when the default options are missing" do | ||
Merb::Plugins.config[:merb_cache] = { | ||
:fail => 'badconfigoptions' | ||
} | ||
|
||
end | ||
end | ||
|
||
it "should setup the default" do | ||
Merb::Cache.remove_active_cache!(:default) | ||
lambda do | ||
Merb::Cache[:default] | ||
end.should raise_error(Merb::Cache::Store::NotFound) | ||
Merb::Cache.setup_default | ||
Merb::Cache[:default].should be_a_kind_of(Merb::Cache::Store) | ||
end | ||
it "should setup the default" do | ||
Merb::Cache.remove_active_cache!(:default) | ||
lambda do | ||
Merb::Cache[:default] | ||
end.should raise_error(Merb::Cache::Store::NotFound) | ||
Merb::Cache.setup_default | ||
Merb::Cache[:default].should be_a_kind_of(Merb::Cache::Store) | ||
end | ||
|
||
it "should not overwrite the existing object" do | ||
Merb::Cache.setup_default | ||
obj = Merb::Cache[:default] | ||
Merb::Cache.setup_default | ||
Merb::Cache[:default].should equal(obj) | ||
end | ||
it "should not overwrite the existing object" do | ||
Merb::Cache.setup_default | ||
obj = Merb::Cache[:default] | ||
Merb::Cache.setup_default | ||
Merb::Cache[:default].should equal(obj) | ||
end | ||
|
||
it "should overwrite the existing cache with the ! version" do | ||
Merb::Cache.setup_default | ||
obj = Merb::Cache[:default] | ||
Merb::Cache.setup_default! | ||
Merb::Cache[:default].should_not equal(obj) | ||
it "should overwrite the existing cache with the ! version" do | ||
Merb::Cache.setup_default | ||
obj = Merb::Cache[:default] | ||
Merb::Cache.setup_default! | ||
Merb::Cache[:default].should_not equal(obj) | ||
end | ||
|
||
end | ||
|
||
describe "cache_path" do | ||
|
||
end | ||
|
||
|
||
end | ||
|
||
describe "returned caches" do | ||
it "should return the format it was stored in" | ||
it "should only cache 200 responses" | ||
describe "returned caches" do | ||
it "should return the format it was stored in" | ||
it "should only cache 200 responses" | ||
end | ||
end |