public
Rubygem
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 16:36:07 -0700 2008
commit  0d066f30f00db013c1dd0ac62b464156dc061b92
tree    9762b08026534fd007a708420adf00b4445d3a22
parent  880fa0676dd04e9530252964b17b2f1065610274
piston / test / integration / test_import_svn_svn.rb
100644 44 lines (35 sloc) 1.663 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
require File.dirname(__FILE__) + "/../test_helper"
require File.dirname(__FILE__) + "/../integration_helpers"
 
class TestImportSvnSvn < Test::Unit::TestCase
  attr_reader :root_path, :repos_path, :wc_path
 
  def setup
    @root_path = Pathname.new("/tmp/import_svn_svn")
    @repos_path = @root_path + "repos"
    @wc_path = @root_path + "wc"
 
    root_path.rmtree rescue nil
    root_path.mkpath
 
    svnadmin :create, repos_path
    svn :checkout, "file://#{repos_path}", wc_path
    svn :mkdir, wc_path + "trunk", wc_path + "tags", wc_path + "branches", wc_path + "trunk/vendor"
    svn :commit, wc_path, "--message", "'first commit'"
  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 + "trunk/vendor/ssl_requirement"
 
    assert_equal "A vendor/ssl_requirement
A vendor/ssl_requirement/test
A vendor/ssl_requirement/test/ssl_requirement_test.rb
A vendor/ssl_requirement/lib
A vendor/ssl_requirement/lib/ssl_requirement.rb
A vendor/ssl_requirement/.piston.yml
A vendor/ssl_requirement/README
".split("\n").sort, svn(:status, wc_path + "trunk/vendor/").gsub((wc_path + "trunk/").to_s, "").split("\n").sort
 
    info = YAML.load(File.read(wc_path + "trunk/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