public
Description: Piston is a utility that eases vendor branch management. This repository is a complete reimplementation of Piston to provide different backends, depending on the repositories and working copies you pistonize from.
Homepage: http://piston.rubyforge.org/
Clone URL: git://github.com/francois/piston.git
piston / test / unit / git / working_copy / test_git_working_copy_creation.rb
100644 27 lines (22 sloc) 0.567 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
require File.dirname(__FILE__) + "/../../../test_helper"
 
class TestGitWorkingCopyCreation < Test::Unit::TestCase
  def setup
    @wcdir = Pathname.new("tmp/wc")
    @wcdir.rmtree rescue nil
    @wc = Piston::Git::WorkingCopy.new(@wcdir)
    @wc.stubs(:git)
  end
 
  def teardown
    @wcdir.rmtree rescue nil
  end
 
  def test_create_does_a_simple_mkpath
    @wcdir.expects(:mkpath)
    @wc.create
  end
 
  def test_create_succeeds_even_if_mkpath_fails
    @wcdir.expects(:mkpath).raises(Errno::EEXIST)
    assert_nothing_raised do
      @wc.create
    end
  end
end