Refactored Release and Track models, fixed tests

This commit is contained in:
Gregory Eremin
2012-07-09 02:22:23 +04:00
parent 7de2a66613
commit b97625597e
11 changed files with 107 additions and 57 deletions
+17 -2
View File
@@ -1,20 +1,35 @@
require "spec_helper"
describe MusicBrainz do
before(:all) {
@old_cache_path = MusicBrainz::Tools::Cache.cache_path
}
before(:each) {
STDOUT.stub!(:puts)
$stdout.stub!(:puts)
MusicBrainz::Tools::Cache.cache_path = nil
}
after(:all) {
MusicBrainz.cache_path.nil
MusicBrainz::Tools::Cache.cache_path = @old_cache_path
}
it "allows deprecated use of cache_path" do
MusicBrainz::Tools::Cache.cache_path = "some/path"
MusicBrainz::cache_path.should == "some/path"
end
it "allows deprecated use of cache_path=" do
MusicBrainz.cache_path = "some/path"
MusicBrainz::Tools::Cache.cache_path.should == "some/path"
end
it "allows deprecated use of query_interval" do
MusicBrainz::Tools::Proxy.query_interval = 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
end