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
francois (author)
Tue May 13 17:17:53 -0700 2008
commit  1d52246f7acabb0fdec2f555430702840146d418
tree    744b3fa8d01e231c8493bedd58a04a48fccff70c
parent  0d066f30f00db013c1dd0ac62b464156dc061b92
piston / test / integration / test_import_svn_git.rb
100644 53 lines (44 sloc) 1.73 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
require File.dirname(__FILE__) + "/../test_helper"
require File.dirname(__FILE__) + "/../integration_helpers"
 
class TestImportSvnGit < Test::Unit::TestCase
  attr_reader :root_path, :repos_path, :wc_path
 
  def setup
    @root_path = Pathname.new("/tmp/import_svn_git")
    @repos_path = @root_path + "repos"
    @wc_path = @root_path + "wc"
 
    root_path.rmtree rescue nil
    root_path.mkpath
 
    wc_path.mkpath
    Dir.chdir(wc_path) do
      git(:init)
      File.open(wc_path + "README", "wb") {|f| f.write "Hello World!"}
      (wc_path + "vendor").mkdir
      File.open(wc_path + "vendor/.gitignore", "wb") {|f| f.write "*.swp"}
      git(:add, ".")
      git(:commit, "-m", "'first commit'")
    end
  end
 
  def teardown
    root_path.rmtree rescue nil
  end
 
  def test_import
    piston :import, "http://dev.rubyonrails.org/svn/rails/plugins/ssl_requirement/", wc_path + "vendor/ssl_requirement"
 
    Dir.chdir(wc_path) do
      assert_equal %Q(# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
#\tnew file: vendor/ssl_requirement/.piston.yml
#\tnew file: vendor/ssl_requirement/README
#\tnew file: vendor/ssl_requirement/lib/ssl_requirement.rb
#\tnew file: vendor/ssl_requirement/test/ssl_requirement_test.rb
#
).split("\n").sort, git(:status).split("\n").sort
    end
 
    info = YAML.load(File.read(wc_path + "vendor/ssl_requirement/.piston.yml"))
    assert_equal 1, info["format"]
    assert_equal "http://dev.rubyonrails.org/svn/rails/plugins/ssl_requirement/", info["repository_url"]
    assert_equal "Piston::Svn::Repository", info["repository_class"]
    assert_equal "5ecf4fe2-1ee6-0310-87b1-e25e094e27de", info["handler"][Piston::Svn::UUID]
  end
end