Sha256: 010a0c35596b45a35a744612e9435f31f609e60e88856b2e64d3bf3fd09001aa

Contents?: true

Size: 958 Bytes

Versions: 10

Compression:

Stored size: 958 Bytes

Contents

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

describe Reflection::Directory::Base do  
  before(:each) do
    @subject = Reflection::Directory::Base.new("/test/home/path")
  end

  describe '#exists?' do
    it 'should now if the path exists' do
      File.stub!(:exist?).and_return(true)
      @subject.exists?.should be_true
    end
  end
  
  describe '#parent' do
    it 'should find the parent of the last directory living in path' do
      @subject.parent.path.should eql('/test/home')
    end
  end
  
  describe '#name' do
    it 'should find the name of the directory living at the end of path' do
      @subject.name.should eql('path')
    end
  end
  
  describe '#git_index' do
    it 'should join an .git index directory to path' do
      @subject.git_index.should eql('/test/home/path/.git')
    end
  end
  
  describe '#to_s' do
    it 'should resolve as path' do
      @subject.to_s.should eql('/test/home/path')
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
basiszwo-reflection-0.5.1 spec/reflection/directory/base_spec.rb
reflection-0.5.0 spec/reflection/directory/base_spec.rb
reflection-0.4.6 spec/reflection/directory/base_spec.rb
reflection-0.4.5 spec/reflection/directory/base_spec.rb
reflection-0.4.4 spec/reflection/directory/base_spec.rb
reflection-0.4.3 spec/reflection/directory/base_spec.rb
reflection-0.4.1 spec/reflection/directory/base_spec.rb
reflection-0.4.0 spec/reflection/directory/base_spec.rb
reflection-0.3.1 spec/reflection/directory/base_spec.rb
reflection-0.0.2 spec/reflection/directory/base_spec.rb