git-process-lib 2.0.4 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,8 +3,8 @@ module PullRequestHelper
3
3
  def create_pull_request(opts = {})
4
4
  v = {
5
5
  :head_remote => 'testrepo',
6
- :head_repo => 'test_repo',
7
- :base_repo => 'test_repo',
6
+ :head_repo => 'tester/test_repo',
7
+ :base_repo => 'tester/test_repo',
8
8
  :head_branch => 'test_branch',
9
9
  :base_branch => 'source_branch',
10
10
  :api_url => 'https://api.github.com',
@@ -1,9 +1,9 @@
1
1
  require 'git-process/pull_request'
2
- #require 'git-process/github_configuration'
3
2
  require 'github_test_helper'
4
3
  require 'pull_request_helper'
5
4
  require 'GitRepoHelper'
6
- require 'hashie'
5
+ require 'sawyer'
6
+ require 'octokit'
7
7
 
8
8
 
9
9
  describe GitProc::PullRequest do
@@ -41,13 +41,15 @@ describe GitProc::PullRequest do
41
41
  GitProc::PullRequest.stub(:create_pull_request_client).and_return(pr_client)
42
42
  #PullRequest.stub(:create_pull_request_client).with(anything, 'origin', 'jdigger/git-process').and_return(pr_client)
43
43
  gitlib.should_receive(:push)
44
- pr_client.should_receive(:create).with('develop', 'master', 'master', '').and_return(Hashie::Mash.new({:html_url => 'http://test'}))
44
+ agent = Sawyer::Agent.new(Octokit::Default::API_ENDPOINT, {})
45
+ sawyer_resource = Sawyer::Resource.new(agent, {:html_url => 'http://test'})
46
+ pr_client.should_receive(:create).with('develop', 'master', 'master', '').and_return(sawyer_resource)
45
47
 
46
48
  gitprocess.runner
47
49
  end
48
50
 
49
51
 
50
- it "should fail if the base and head branch are the same" do
52
+ it 'should fail if the base and head branch are the same' do
51
53
  gitlib.remote.add('origin', 'git@github.com:jdigger/git-process.git')
52
54
 
53
55
  expect {
@@ -79,7 +81,7 @@ describe GitProc::PullRequest do
79
81
  end
80
82
 
81
83
 
82
- it "should checkout the branch for the pull request" do
84
+ it 'should checkout the branch for the pull request' do
83
85
  add_remote(:head)
84
86
  stub_fetch(:head)
85
87
 
@@ -88,9 +90,9 @@ describe GitProc::PullRequest do
88
90
  expect_checkout_pr_head()
89
91
  expect_upstream_set()
90
92
 
91
- gitlib.stub(:branch).with(nil, :no_color => true, :all => true).and_return("")
92
- gitlib.stub(:branch).with(nil, :no_color => true, :remote => true).and_return("")
93
- gitlib.should_receive(:rebase).with('test_repo/master', {})
93
+ gitlib.stub(:branch).with(nil, :no_color => true, :all => true).and_return('')
94
+ gitlib.stub(:branch).with(nil, :no_color => true, :remote => true).and_return('')
95
+ gitlib.should_receive(:rebase).with('tester/test_repo/master', {})
94
96
 
95
97
  gitprocess.runner
96
98
  end
@@ -98,7 +100,7 @@ describe GitProc::PullRequest do
98
100
  end
99
101
 
100
102
 
101
- describe "with repo name and PR #" do
103
+ describe 'with repo name and PR #' do
102
104
 
103
105
  def pull_request
104
106
  @pr ||= create_pull_request(:base_remote => 'sourcerepo', :base_repo => 'source_repo')
@@ -111,7 +113,7 @@ describe GitProc::PullRequest do
111
113
  end
112
114
 
113
115
 
114
- it "should checkout the branch for the pull request" do
116
+ it 'should checkout the branch for the pull request' do
115
117
  add_remote(:head)
116
118
  add_remote(:base)
117
119
  stub_fetch(:head)
@@ -125,7 +127,7 @@ describe GitProc::PullRequest do
125
127
 
126
128
  gitlib.stub(:branch).with(nil, :no_color => true, :all => true).and_return('')
127
129
  gitlib.stub(:branch).with(nil, :no_color => true, :remote => true).and_return('')
128
- gitlib.should_receive(:rebase).with('test_repo/master', {})
130
+ gitlib.should_receive(:rebase).with('tester/test_repo/master', {})
129
131
 
130
132
  gitprocess.runner
131
133
  end
@@ -106,7 +106,7 @@ describe RebaseToMaster do
106
106
  gl.checkout('ab', :new_branch => 'origin/int-br')
107
107
 
108
108
  my_branches = gl.branches
109
- my_branches.include?('origin/master').should be_false
109
+ my_branches.include?('origin/master').should be false
110
110
  my_branches['ab'].sha.should == my_branches['origin/int-br'].sha
111
111
 
112
112
  gl.stub(:repo_name).and_return('test_repo')
@@ -175,11 +175,11 @@ describe RebaseToMaster do
175
175
  change_file_and_commit('a', '', gl)
176
176
  gl.checkout('fb', :new_branch => 'origin/master')
177
177
 
178
- gl.branches.include?('_parking_OLD_').should be_false
178
+ gl.branches.include?('_parking_OLD_').should be false
179
179
 
180
180
  create_process(gl).remove_feature_branch
181
181
 
182
- gl.branches.include?('_parking_OLD_').should be_true
182
+ gl.branches.include?('_parking_OLD_').should be true
183
183
  gl.branches.current.name.should == '_parking_'
184
184
  end
185
185
  end
@@ -192,11 +192,11 @@ describe RebaseToMaster do
192
192
  change_file_and_commit('a', '', gl)
193
193
 
194
194
  gl.checkout('fb', :new_branch => 'origin/master')
195
- gl.branches.include?('fb').should be_true
195
+ gl.branches.include?('fb').should be true
196
196
 
197
197
  create_process(gl).remove_feature_branch
198
198
 
199
- gl.branches.include?('fb').should be_false
199
+ gl.branches.include?('fb').should be false
200
200
  gl.branches.current.name.should == '_parking_'
201
201
  end
202
202
  end
@@ -207,7 +207,7 @@ describe RebaseToMaster do
207
207
  gl.checkout('fb', :new_branch => 'origin/master')
208
208
  change_file_and_commit('a', '', gl)
209
209
 
210
- gl.branches.include?('fb').should be_true
210
+ gl.branches.include?('fb').should be true
211
211
 
212
212
  expect { create_process(gl).remove_feature_branch }.to raise_error GitProcessError
213
213
  end
@@ -220,10 +220,10 @@ describe RebaseToMaster do
220
220
  gitlib.branch('fb', :base_branch => 'master')
221
221
 
222
222
  clone_repo('fb') do |gl|
223
- gl.branches.include?('origin/fb').should be_true
223
+ gl.branches.include?('origin/fb').should be true
224
224
  create_process(gl).remove_feature_branch
225
- gl.branches.include?('origin/fb').should be_false
226
- gitlib.branches.include?('fb').should be_false
225
+ gl.branches.include?('origin/fb').should be false
226
+ gitlib.branches.include?('fb').should be false
227
227
  gl.branches.current.name.should == '_parking_'
228
228
  end
229
229
  end
@@ -292,7 +292,7 @@ describe RebaseToMaster do
292
292
  stub_fetch(:base, gl)
293
293
 
294
294
  stub_get("https://api.github.com/repos/#{head_repo_name}/pulls/#{pull_request_number}", :body => pull_request)
295
- stub_patch("https://api.github.com/repos/#{head_repo_name}/pulls/#{pull_request_number}")
295
+ stub_patch("https://api.github.com/repos/#{head_repo_name}/pulls/#{pull_request_number}", :body => pull_request)
296
296
  end
297
297
 
298
298
 
data/spec/sync_spec.rb CHANGED
@@ -65,6 +65,23 @@ describe Sync do
65
65
  end
66
66
  end
67
67
 
68
+ it 'should work when the branch name contains a slash' do
69
+ Given do
70
+ origin 'user/fb', :new_branch => 'master'
71
+ create_commit :b
72
+ local 'user/fb', :new_branch => 'origin/user/fb'
73
+ create_commit :c
74
+ end
75
+
76
+ @local.checkout('user/fb')
77
+ create_process(@local).runner
78
+
79
+ Then do
80
+ branch_tip(local_repo, 'user/fb').should == branch_tip(origin_repo, 'user/fb')
81
+ branch_tip(local_repo, 'user/fb').should == @local.sha('origin/user/fb')
82
+ end
83
+ end
84
+
68
85
 
69
86
  describe 'when forcing the push with a merge' do
70
87
 
@@ -1256,12 +1273,12 @@ describe Sync do
1256
1273
 
1257
1274
  clone_repo('fb', 'a_remote') do |gl|
1258
1275
  change_file_and_commit('a', 'hello', gl)
1259
- gl.branches.include?('a_remote/fb').should be_true
1276
+ gl.branches.include?('a_remote/fb').should be true
1260
1277
 
1261
1278
  GitProc::Sync.new(gl, :rebase => false, :force => false, :log_level => log_level).runner
1262
1279
 
1263
- gl.branches.include?('a_remote/fb').should be_true
1264
- gitlib.branches.include?('fb').should be_true
1280
+ gl.branches.include?('a_remote/fb').should be true
1281
+ gitlib.branches.include?('fb').should be true
1265
1282
  end
1266
1283
  end
1267
1284
 
metadata CHANGED
@@ -1,161 +1,131 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: git-process-lib
3
- version: !ruby/object:Gem::Version
4
- hash: 7
5
- prerelease:
6
- segments:
7
- - 2
8
- - 0
9
- - 4
10
- version: 2.0.4
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.0.0
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Jim Moore
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2014-01-29 00:00:00 -07:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
11
+ date: 2016-03-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
22
14
  name: octokit
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ~>
28
- - !ruby/object:Gem::Version
29
- hash: 119
30
- segments:
31
- - 1
32
- - 24
33
- - 0
34
- version: 1.24.0
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '4.3'
35
20
  type: :runtime
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: json
39
21
  prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ~>
44
- - !ruby/object:Gem::Version
45
- hash: 31
46
- segments:
47
- - 1
48
- - 8
49
- version: "1.8"
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '4.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: netrc
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.11'
50
34
  type: :runtime
51
- version_requirements: *id002
52
- - !ruby/object:Gem::Dependency
53
- name: multi_json
54
35
  prerelease: false
55
- requirement: &id003 !ruby/object:Gem::Requirement
56
- none: false
57
- requirements:
58
- - - ~>
59
- - !ruby/object:Gem::Version
60
- hash: 31
61
- segments:
62
- - 1
63
- - 8
64
- version: "1.8"
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.11'
41
+ - !ruby/object:Gem::Dependency
42
+ name: json
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.8'
65
48
  type: :runtime
66
- version_requirements: *id003
67
- - !ruby/object:Gem::Dependency
68
- name: trollop
69
49
  prerelease: false
70
- requirement: &id004 !ruby/object:Gem::Requirement
71
- none: false
72
- requirements:
73
- - - ~>
74
- - !ruby/object:Gem::Version
75
- hash: 47
76
- segments:
77
- - 1
78
- - 16
79
- version: "1.16"
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.8'
55
+ - !ruby/object:Gem::Dependency
56
+ name: trollop
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.1'
80
62
  type: :runtime
81
- version_requirements: *id004
82
- - !ruby/object:Gem::Dependency
83
- name: highline
84
63
  prerelease: false
85
- requirement: &id005 !ruby/object:Gem::Requirement
86
- none: false
87
- requirements:
88
- - - "="
89
- - !ruby/object:Gem::Version
90
- hash: 21
91
- segments:
92
- - 1
93
- - 6
94
- - 13
95
- version: 1.6.13
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2.1'
69
+ - !ruby/object:Gem::Dependency
70
+ name: highline
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.7'
96
76
  type: :runtime
97
- version_requirements: *id005
98
- - !ruby/object:Gem::Dependency
99
- name: addressable
100
77
  prerelease: false
101
- requirement: &id006 !ruby/object:Gem::Requirement
102
- none: false
103
- requirements:
104
- - - ~>
105
- - !ruby/object:Gem::Version
106
- hash: 5
107
- segments:
108
- - 2
109
- - 3
110
- version: "2.3"
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.7'
83
+ - !ruby/object:Gem::Dependency
84
+ name: addressable
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: 2.3.5
90
+ - - "<"
91
+ - !ruby/object:Gem::Version
92
+ version: '2.4'
111
93
  type: :runtime
112
- version_requirements: *id006
113
- - !ruby/object:Gem::Dependency
114
- name: gem-man
115
94
  prerelease: false
116
- requirement: &id007 !ruby/object:Gem::Requirement
117
- none: false
118
- requirements:
119
- - - ~>
120
- - !ruby/object:Gem::Version
121
- hash: 13
122
- segments:
123
- - 0
124
- - 3
125
- version: "0.3"
95
+ version_requirements: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: 2.3.5
100
+ - - "<"
101
+ - !ruby/object:Gem::Version
102
+ version: '2.4'
103
+ - !ruby/object:Gem::Dependency
104
+ name: gem-man
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: '0.3'
126
110
  type: :runtime
127
- version_requirements: *id007
128
- - !ruby/object:Gem::Dependency
129
- name: faraday
130
111
  prerelease: false
131
- requirement: &id008 !ruby/object:Gem::Requirement
132
- none: false
133
- requirements:
134
- - - "="
135
- - !ruby/object:Gem::Version
136
- hash: 45
137
- segments:
138
- - 0
139
- - 8
140
- - 9
141
- version: 0.8.9
142
- type: :runtime
143
- version_requirements: *id008
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "~>"
115
+ - !ruby/object:Gem::Version
116
+ version: '0.3'
144
117
  description: The libraries for the git-process suite of tools
145
- email:
118
+ email:
146
119
  - moore.jim@gmail.com
147
120
  executables: []
148
-
149
121
  extensions: []
150
-
151
122
  extra_rdoc_files: []
152
-
153
- files:
123
+ files:
154
124
  - CHANGELOG.md
155
125
  - Gemfile
156
126
  - Gemfile.lock
157
127
  - LICENSE
158
- - README.md
128
+ - README.adoc
159
129
  - Rakefile
160
130
  - bin/git-new-fb
161
131
  - bin/git-pull-req
@@ -219,43 +189,31 @@ files:
219
189
  - spec/rebase_to_master_spec.rb
220
190
  - spec/spec_helper.rb
221
191
  - spec/sync_spec.rb
222
- has_rdoc: true
223
192
  homepage: http://jdigger.github.com/git-process/
224
- licenses:
225
- - ASL2
193
+ licenses:
194
+ - Apache-2.0
195
+ metadata: {}
226
196
  post_install_message:
227
197
  rdoc_options: []
228
-
229
- require_paths:
198
+ require_paths:
230
199
  - lib
231
- required_ruby_version: !ruby/object:Gem::Requirement
232
- none: false
233
- requirements:
200
+ required_ruby_version: !ruby/object:Gem::Requirement
201
+ requirements:
234
202
  - - ">="
235
- - !ruby/object:Gem::Version
236
- hash: 57
237
- segments:
238
- - 1
239
- - 8
240
- - 7
241
- version: 1.8.7
242
- required_rubygems_version: !ruby/object:Gem::Requirement
243
- none: false
244
- requirements:
203
+ - !ruby/object:Gem::Version
204
+ version: '2.0'
205
+ required_rubygems_version: !ruby/object:Gem::Requirement
206
+ requirements:
245
207
  - - ">="
246
- - !ruby/object:Gem::Version
247
- hash: 3
248
- segments:
249
- - 0
250
- version: "0"
208
+ - !ruby/object:Gem::Version
209
+ version: '0'
251
210
  requirements: []
252
-
253
211
  rubyforge_project:
254
- rubygems_version: 1.6.2
212
+ rubygems_version: 2.5.1
255
213
  signing_key:
256
- specification_version: 3
214
+ specification_version: 4
257
215
  summary: The libraries for the git-process suite of tools
258
- test_files:
216
+ test_files:
259
217
  - spec/FileHelpers.rb
260
218
  - spec/GitRepoHelper.rb
261
219
  - spec/changed_file_helper_spec.rb
@@ -276,3 +234,4 @@ test_files:
276
234
  - spec/rebase_to_master_spec.rb
277
235
  - spec/spec_helper.rb
278
236
  - spec/sync_spec.rb
237
+ has_rdoc: