1
0
Fork 0
musicbrainz/spec/deprecated/cache_config_spec.rb

33 lines
778 B
Ruby
Raw Normal View History

# -*- encoding : utf-8 -*-
2012-07-06 15:23:47 +00:00
require "spec_helper"
describe MusicBrainz::Deprecated::CacheConfig do
before(:all) {
2012-10-12 12:45:51 +00:00
@old_cache_path = MusicBrainz.config.cache_path
}
2012-07-06 15:23:47 +00:00
before(:each) {
2012-10-12 12:45:51 +00:00
MusicBrainz.config.cache_path = nil
2012-07-06 15:23:47 +00:00
}
after(:all) {
2012-10-12 12:45:51 +00:00
MusicBrainz.config.cache_path = @old_cache_path
2012-07-06 15:23:47 +00:00
}
it "allows deprecated use of cache_path" do
2012-10-12 12:45:51 +00:00
MusicBrainz.config.cache_path = "test1"
expect(MusicBrainz::Tools::Cache.cache_path).to eq "test1"
expect(MusicBrainz.cache_path).to eq "test1"
end
it "allows deprecated use of cache_path=" do
2012-10-12 12:45:51 +00:00
MusicBrainz::Tools::Cache.cache_path = "test2"
expect(MusicBrainz.config.cache_path).to eq "test2"
2012-10-12 12:45:51 +00:00
MusicBrainz.cache_path = "test3"
expect(MusicBrainz.config.cache_path).to eq "test3"
2012-07-06 15:23:47 +00:00
end
end