Sha256: 5136b8060e947eab623020c87a219a9ba3b62f320a4e18b546e8e1059d5ca1a4

Contents?: true

Size: 746 Bytes

Versions: 4

Compression:

Stored size: 746 Bytes

Contents

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
repertoire-0.2.3 spec/media/type_spec.rb
repertoire-0.2.1 spec/media/type_spec.rb
repertoire-0.2.0 spec/media/type_spec.rb
repertoire-0.2.2 spec/media/type_spec.rb