GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

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)
Sun Mar 16 19:43:20 -0700 2008
commit  0b96e22dc0b68781ea443ae39afab6c246dd1b47
tree    19e3468e9ae95e254b9bd6e36c0872c66ec8e3ec
parent  9b7391c8f907342387fff51aef4f020f1065ae85
piston / test / test_svn_repository_guessing.rb
100644 40 lines (32 sloc) 1.537 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
require File.dirname(__FILE__) + "/test_helper"
 
class TestSvnRepositoryGuessing < Test::Unit::TestCase
  def test_guesses_with_svn_protocol
    assert Piston::Svn::Repository.understands_url?("svn://a.host.com/")
  end
 
  def test_guesses_with_svn_plus_bla_protocol
    assert Piston::Svn::Repository.understands_url?("svn+bla://username@a.host.com/")
  end
 
  def test_guesses_with_svn_plus_ssh_protocol
    assert Piston::Svn::Repository.understands_url?("svn+ssh://username@a.host.com/")
  end
 
  def test_contacts_repository_for_file_protocol
    url = "file:///home/username/svn/projects/trunk"
    Piston::Svn::Repository.expects(:svn).with(:info, url).returns("Repository UUID: abcdef\n")
    assert Piston::Svn::Repository.understands_url?(url)
  end
 
  def test_contacts_repository_for_http_protocol
    url = "http://svn.collab.net/repos/svn/trunk"
    Piston::Svn::Repository.expects(:svn).with(:info, url).returns("Repository UUID: abcdef\n")
    assert Piston::Svn::Repository.understands_url?(url)
  end
 
  def test_says_does_not_understand_when_svn_info_errors_out
    url = "http://rubyonrails.org/"
    Piston::Svn::Repository.expects(:svn).with(:info, url).raises(Piston::Svn::Client::Failed)
    deny Piston::Svn::Repository.understands_url?(url)
  end
 
  def test_says_does_not_understand_when_svn_command_not_found
    url = "http://rubyonrails.org/"
    Piston::Svn::Repository.expects(:svn).with(:info, url).raises(Piston::Svn::Client::BadCommand)
    deny Piston::Svn::Repository.understands_url?(url)
  end
end