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

public
Rubygem
Description: The official `github` command line helper for simplifying your GitHub experience.
Homepage: http://github.com
Clone URL: git://github.com/defunkt/github-gem.git
Fix the 2 pending specs
kballard (author)
Sat May 31 19:48:18 -0700 2008
commit  3489bb06c1f1f3f1a3ca1d7dc5a93b130650b6b3
tree    44870f9ab0a59cc1cedc392eddb998226851b9b7
parent  011ffe516d57536eb157acc61d82695fb0bf63ae
...
40
41
42
43
 
 
 
 
 
 
44
 
45
 
 
46
47
48
 
49
50
 
51
52
53
...
40
41
42
 
43
44
45
46
47
48
49
50
51
52
53
54
55
 
56
57
 
58
59
60
61
0
@@ -40,14 +40,22 @@ end
0
 
0
 desc "Track another user's repository."
0
 flags :private => "Use git@github.com: instead of git://github.com/."
0
-command :track do |user|
0
+command :track do |remote, user|
0
+ # track remote user
0
+ # track remote user/repo
0
+ # track user
0
+ # track user/repo
0
+ user, remote = remote, nil if user.nil?
0
   die "Specify a user to track" if user.nil?
0
+ user, repo = user.split("/", 2)
0
   die "Already tracking #{user}" if helper.tracking?(user)
0
+ repo = @helper.project if repo.nil?
0
+ repo.chomp!(".git")
0
 
0
   if options[:private]
0
- git "remote add #{user} #{helper.private_url_for(user)}"
0
+ git "remote add #{user} #{helper.private_url_for_user_and_repo(user, repo)}"
0
   else
0
- git "remote add #{user} #{helper.public_url_for(user)}"
0
+ git "remote add #{user} #{helper.public_url_for_user_and_repo(user, repo)}"
0
   end
0
 end
0
 
...
81
82
83
 
 
 
 
 
 
 
 
84
85
 
86
87
88
89
 
90
91
92
...
81
82
83
84
85
86
87
88
89
90
91
92
 
93
94
95
96
 
97
98
99
100
0
@@ -81,12 +81,20 @@ helper :branch_name do
0
   user_and_branch.last
0
 end
0
 
0
+helper :public_url_for_user_and_repo do |user, repo|
0
+ "git://github.com/#{user}/#{repo}.git"
0
+end
0
+
0
+helper :private_url_for_user_and_repo do |user, repo|
0
+ "git@github.com:#{user}/#{repo}.git"
0
+end
0
+
0
 helper :public_url_for do |user|
0
- "git://github.com/#{user}/#{project}.git"
0
+ public_url_for_user_and_repo user, project
0
 end
0
 
0
 helper :private_url_for do |user|
0
- "git@github.com:#{user}/#{project}.git"
0
+ private_url_for_user_and_repo user, project
0
 end
0
 
0
 helper :homepage_for do |user, branch|
...
35
36
37
38
 
39
40
41
42
43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
45
46
...
60
61
62
63
64
65
66
67
68
69
70
71
72
...
35
36
37
 
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
...
81
82
83
 
 
 
 
 
 
 
84
85
86
0
@@ -35,12 +35,33 @@ describe GitHub::Helper do
0
   end
0
 
0
   helper :private_url_for do
0
- it "should return ssh-style url" do
0
+ it "should return an ssh-style url" do
0
       setup_url_for :origin, "user", "merb-core"
0
       @helper.private_url_for("wycats").should == "git@github.com:wycats/merb-core.git"
0
     end
0
   end
0
 
0
+ helper :private_url_for_user_and_repo do
0
+ it "should return an ssh-style url" do
0
+ @helper.should_not_receive(:project)
0
+ @helper.private_url_for_user_and_repo("defunkt", "github-gem").should == "git@github.com:defunkt/github-gem.git"
0
+ end
0
+ end
0
+
0
+ helper :public_url_for do
0
+ it "should return a git:// URL" do
0
+ setup_url_for :origin, "user", "merb-core"
0
+ @helper.public_url_for("wycats").should == "git://github.com/wycats/merb-core.git"
0
+ end
0
+ end
0
+
0
+ helper :public_url_for_user_and_repo do
0
+ it "should return a git:// URL" do
0
+ @helper.should_not_receive(:project)
0
+ @helper.public_url_for_user_and_repo("defunkt", "github-gem").should == "git://github.com/defunkt/github-gem.git"
0
+ end
0
+ end
0
+
0
   helper :project do
0
     it "should return project-awesome" do
0
       setup_url_for :origin, "user", "project-awesome"
0
@@ -60,13 +81,6 @@ describe GitHub::Helper do
0
     end
0
   end
0
 
0
- helper :public_url_for do
0
- it "should return git:// URL" do
0
- setup_url_for :origin, "user", "merb-core"
0
- @helper.public_url_for("wycats").should == "git://github.com/wycats/merb-core.git"
0
- end
0
- end
0
-
0
   helper :repo_for do
0
     it "should return mephisto.git" do
0
       setup_url_for :mojombo, "mojombo", "mephisto"
...
114
115
116
117
118
119
120
121
122
 
 
 
 
123
124
125
126
127
128
129
130
131
132
133
134
 
 
 
 
 
 
135
136
137
...
114
115
116
 
 
 
 
 
 
117
118
119
120
121
122
123
124
 
 
 
 
 
 
 
 
125
126
127
128
129
130
131
132
133
0
@@ -114,24 +114,20 @@ EOF
0
   end
0
 
0
   specify "track should accept user/project syntax" do
0
- pending do
0
- running :track, "defunkt/github-gem.git" do
0
- setup_url_for
0
- @helper.should_receive(:tracking?).with("defunkt").and_return false
0
- @command.should_receive(:git).with("remote add defunkt git://github.com/defunkt/github-gem.git")
0
- end
0
+ running :track, "defunkt/github-gem.git" do
0
+ setup_url_for
0
+ @helper.should_receive(:tracking?).with("defunkt").and_return false
0
+ @command.should_receive(:git).with("remote add defunkt git://github.com/defunkt/github-gem.git")
0
     end
0
   end
0
 
0
   specify "track defunkt/github-gem.git should function with no origin remote" do
0
- pending do
0
- running :track, "defunkt/github-gem.git" do
0
- @helper.stub!(:url_for).with(:origin).and_return ""
0
- @helper.stub!(:tracking?).and_return false
0
- @command.should_receive(:git).with("remote add defunkt git://github.com/defunkt/github-gem.git")
0
- self.should_not raise_error(SystemExit)
0
- stderr.should_not =~ /^Error/
0
- end
0
+ running :track, "defunkt/github-gem.git" do
0
+ @helper.stub!(:url_for).with(:origin).and_return ""
0
+ @helper.stub!(:tracking?).and_return false
0
+ @command.should_receive(:git).with("remote add defunkt git://github.com/defunkt/github-gem.git")
0
+ self.should_not raise_error(SystemExit)
0
+ stderr.should_not =~ /^Error/
0
     end
0
   end
0
 

Comments

    No one has commented yet.