Mass rewrite

This commit is contained in:
Gregory Eremin
2012-10-12 16:45:51 +04:00
parent 3bf68d152e
commit 7c42a90a6c
46 changed files with 656 additions and 696 deletions
+24 -12
View File
@@ -4,35 +4,47 @@ require "spec_helper"
describe MusicBrainz do
before(:all) {
@old_cache_path = MusicBrainz::Tools::Cache.cache_path
@old_cache_path = MusicBrainz.config.cache_path
@old_query_interval = MusicBrainz.config.query_interval
}
before(:each) {
$stdout.stub!(:puts)
MusicBrainz::Tools::Cache.cache_path = nil
MusicBrainz.config.cache_path = nil
MusicBrainz.config.query_interval = nil
}
after(:all) {
MusicBrainz::Tools::Cache.cache_path = @old_cache_path
MusicBrainz.config.cache_path = @old_cache_path
MusicBrainz.config.query_interval = @old_query_interval
}
it "allows deprecated use of cache_path" do
MusicBrainz::Tools::Cache.cache_path = "some/path"
MusicBrainz::cache_path.should == "some/path"
MusicBrainz.config.cache_path = "test1"
MusicBrainz::Tools::Cache.cache_path.should == "test1"
MusicBrainz.cache_path.should == "test1"
end
it "allows deprecated use of cache_path=" do
MusicBrainz.cache_path = "some/path"
MusicBrainz::Tools::Cache.cache_path.should == "some/path"
MusicBrainz::Tools::Cache.cache_path = "test2"
MusicBrainz.config.cache_path.should == "test2"
MusicBrainz.cache_path = "test3"
MusicBrainz.config.cache_path.should == "test3"
end
it "allows deprecated use of query_interval" do
MusicBrainz::Tools::Proxy.query_interval = 2
MusicBrainz::query_interval.should == 2
MusicBrainz.config.query_interval = 2
MusicBrainz::Tools::Proxy.query_interval.should == 2
MusicBrainz.query_interval.should == 2
end
it "allows deprecated use of query_interval=" do
MusicBrainz.query_interval = 2
MusicBrainz::Tools::Proxy.query_interval.should == 2
MusicBrainz::Tools::Proxy.query_interval = 3
MusicBrainz.config.query_interval.should == 3
MusicBrainz.query_interval = 4
MusicBrainz.config.query_interval.should == 4
end
end