Sha256: 5a7cfebfc9335dd405a25d0978447663756228e14eb40ed5865c9667a51e93dd

Contents?: true

Size: 1.03 KB

Versions: 25

Compression:

Stored size: 1.03 KB

Contents

#!/usr/bin/env ruby

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

class TestGitPath < Test::Unit::TestCase
  
  def setup
    set_file_paths
    @git = Git.open(@wdir)
  end
  
  def test_initalize_with_good_path_and_check_path
    path = Git::Path.new(@git.index.to_s, true)
    assert_equal @git.index.to_s, path.to_s
  end
  
  def test_initialize_with_bad_path_and_check_path
    assert_raises ArgumentError do
      Git::Path.new('/this path does not exist', true)
    end
  end
  
  def test_initialize_with_bad_path_and_no_check
    path = Git::Path.new('/this path does not exist', false)
    assert_equal '/this path does not exist', path.to_s
  end

  def test_readables
    assert(@git.dir.readable?)
    assert(@git.index.readable?)
    assert(@git.repo.readable?)
  end
  
  def test_readables_in_temp_dir
    in_temp_dir do |dir|
      FileUtils.cp_r(@wdir, 'test')
      g = Git.open(File.join(dir, 'test'))
      
      assert(g.dir.writable?)
      assert(g.index.writable?)
      assert(g.repo.writable?)
    end
  end
  
end

Version data entries

25 entries across 25 versions & 3 rubygems

Version Path
titanous-git-1.1.0 tests/units/test_git_path.rb
redcar-dev-0.12.1dev-java plugins/scm_git/vendor/ruby-git/tests/units/test_git_path.rb
redcar-dev-0.12.0dev-java plugins/scm_git/vendor/ruby-git/tests/units/test_git_path.rb
redcar-0.11 plugins/scm_git/vendor/ruby-git/tests/units/test_git_path.rb
redcar-0.11.0dev plugins/scm_git/vendor/ruby-git/tests/units/test_git_path.rb
redcar-0.10 plugins/scm_git/vendor/ruby-git/tests/units/test_git_path.rb
redcar-0.9.2 plugins/scm_git/vendor/ruby-git/tests/units/test_git_path.rb
redcar-0.9.1 plugins/scm_git/vendor/ruby-git/tests/units/test_git_path.rb
redcar-0.9.0 plugins/scm_git/vendor/ruby-git/tests/units/test_git_path.rb
redcar-0.8.1 plugins/scm_git/vendor/ruby-git/tests/units/test_git_path.rb
redcar-0.8 plugins/scm_git/vendor/ruby-git/tests/units/test_git_path.rb
redcar-0.7 plugins/scm_git/vendor/ruby-git/tests/units/test_git_path.rb
redcar-0.6.1 plugins/scm_git/vendor/ruby-git/tests/units/test_git_path.rb
redcar-0.6 plugins/scm_git/vendor/ruby-git/tests/units/test_git_path.rb
redcar-0.6.1dev plugins/scm_git/vendor/ruby-git/tests/units/test_git_path.rb
redcar-0.5.1 plugins/scm_git/vendor/ruby-git/tests/units/test_git_path.rb
redcar-0.5 plugins/scm_git/vendor/ruby-git/tests/units/test_git_path.rb
redcar-0.5.6dev plugins/scm_git/vendor/ruby-git/tests/units/test_git_path.rb
redcar-0.5.5dev plugins/scm_git/vendor/ruby-git/tests/units/test_git_path.rb
redcar-0.5.4dev plugins/scm_git/vendor/ruby-git/tests/units/test_git_path.rb