require 'repertoire/media/type' require 'spec_helper' require 'tmpdir' describe Media::Type do it "should have a default name" do Media::Type.name.should be_nil end it "should have default schemes" do Media::Type.schemes.should be_empty end it "should have a default directory" do Media::Type.directory.should be_nil end it "should be able to change the current working directory" do current = Dir.pwd Media::Type.cd(Dir.tmpdir) Dir.pwd.should == Dir.tmpdir Dir.chdir(current) end it "should be able to switch the current working directory" do current = Dir.pwd Media::Type.switch_dir(Dir.tmpdir) do Dir.pwd.should == Dir.tmpdir end Dir.pwd.should == current end end