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 / svn / repository / test_svn_repository_basename.rb
100644 25 lines (19 sloc) 0.8 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
require File.dirname(__FILE__) + "/../../../test_helper"
 
class TestSvnRepositoryBasename < Test::Unit::TestCase
  def test_basename_is_urls_path_last_component
    assert_equal "piston", basename("http://svn.rubyforge.org/var/svn/piston")
  end
 
  def test_basename_is_urls_path_last_component_minus_trunk
    assert_equal "attachment_fu", basename("svn+ssh://some.host.com/svn/attachment_fu/trunk")
  end
 
  def test_basename_is_urls_path_last_component_before_branches
    assert_equal "rails", basename("svn://some.host.com/svn/rails/branches/stable")
  end
 
  def test_basename_is_urls_path_last_component_before_tags
    assert_equal "plugin", basename("https://some.host.com/svn/plugin/tags/stable")
  end
 
  private
  def basename(url)
    Piston::Svn::Repository.new(url).basename
  end
end