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
Search Repo:
Reorganizing tests.
tapajos (author)
Thu May 08 17:49:43 -0700 2008
francois (committer)
Fri May 09 08:25:33 -0700 2008
commit  70813e04ba0b01274987276fe71b76a30ed5f835
tree    961f5688994596972429928d187136d13c70861a
parent  7743b51ab5fd785162108a9f6dee0e5cfaefa706
...
8
9
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
12
13
...
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
0
@@ -8,6 +8,29 @@
0
     @repository = Piston::Repository.new("url")
0
   end
0
   
0
+ def test_guess_asks_each_handler_in_turn
0
+ Piston::Repository.send(:handlers).clear
0
+ Piston::Repository.add_handler(handler = mock("handler"))
0
+ handler.expects(:understands_url?).with("http://a.repos.com/trunk").returns(false)
0
+ assert_raise Piston::Repository::UnhandledUrl do
0
+ Piston::Repository.guess("http://a.repos.com/trunk")
0
+ end
0
+ end
0
+
0
+ def test_guess_returns_first_handler_that_understands_the_url
0
+ Piston::Repository.send(:handlers).clear
0
+ url = "svn://a.repos.com/projects/libcalc/trunk"
0
+
0
+ handler = mock("handler")
0
+ handler.expects(:understands_url?).with(url).returns(true)
0
+ handler_instance = mock("handler_instance")
0
+ handler.expects(:new).with(url).returns(handler_instance)
0
+
0
+ Piston::Repository.add_handler handler
0
+ assert_equal handler_instance, Piston::Repository.guess(url)
0
+ end
0
+
0
+
0
   def test_if_guess_return_GIT_repository_when_url_is_git_repository
0
     assert_equal Piston::Git::Repository.new("git://github.com/francois/piston.git"), Piston::Repository.guess("git://github.com/francois/piston.git")
0
   end
...
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
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
@@ -1,34 +1 @@
0
-require File.dirname(__FILE__) + "/../test_helper"
0
-
0
-class TestRepositoryGuessing < Test::Unit::TestCase
0
- def setup
0
- Piston::Repository.send(:handlers).clear
0
- end
0
-
0
- def test_guess_when_no_handlers_raises
0
- assert_raise Piston::Repository::UnhandledUrl do
0
- Piston::Repository.guess("http://")
0
- end
0
- end
0
-
0
- def test_guess_asks_each_handler_in_turn
0
- Piston::Repository.add_handler(handler = mock("handler"))
0
- handler.expects(:understands_url?).with("http://a.repos.com/trunk").returns(false)
0
- assert_raise Piston::Repository::UnhandledUrl do
0
- Piston::Repository.guess("http://a.repos.com/trunk")
0
- end
0
- end
0
-
0
- def test_guess_returns_first_handler_that_understands_the_url
0
- url = "svn://a.repos.com/projects/libcalc/trunk"
0
-
0
- handler = mock("handler")
0
- handler.expects(:understands_url?).with(url).returns(true)
0
- handler_instance = mock("handler_instance")
0
- handler.expects(:new).with(url).returns(handler_instance)
0
-
0
- Piston::Repository.add_handler handler
0
- assert_equal handler_instance, Piston::Repository.guess(url)
0
- end
0
-end

Comments

    No one has commented yet.