Sha256: 0b79d3bf61ec6417a5b44e135adb252ec2a5b791f55fb41b542ce9d4b9a55227

Contents?: true

Size: 1.32 KB

Versions: 4

Compression:

Stored size: 1.32 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')


describe Gator::Paths do

  before :all do
    @original_pwd = Dir.pwd
    @empty_project = File.expand_path(File.dirname(__FILE__) + '/../../fixtures/empty_gator_project')
    @not_a_project = File.expand_path(File.dirname(__FILE__) + '/../../fixtures/no_gator_file')
  end

  after :all do
    Dir.chdir @original_pwd
  end

  it "should point to the correct gator home in the users directory" do
    Gator::Paths.gator_home.should == File.join(Thor::Util.user_home,".gator")
  end

  it "should point to the correct project base directory" do
    Dir.chdir @empty_project
    Gator::Paths.project_home.should == @empty_project
  end

  it "should point to the correct environment file" do
    Gator::Paths.env_file == File.join( Gator::Paths.gator_home, "environment.rb" )
  end

  it "should return nil for project base directory when not in a project directory" do
    Dir.chdir @not_a_project
    Gator::Paths.project_home.should_not be
  end

  it "should point to the correct project file" do
    Dir.chdir @empty_project
    Gator::Paths.project_file.should == File.join(@empty_project,"gator.rb")
  end

  it "should return nil for project file when not in a project directory" do
    Dir.chdir @not_a_project
    Gator::Paths.project_file.should_not be
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gator-0.0.25.pre spec/core/io/paths_spec.rb
gator-0.0.24.pre spec/core/io/paths_spec.rb
gator-0.0.23.pre spec/core/io/paths_spec.rb
gator-0.0.22.pre spec/core/io/paths_spec.rb