git_reflow 0.4.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,7 @@ module CommandLineHelpers
2
2
  def stub_command_line
3
3
  $commands_ran = []
4
4
  $output = []
5
+ $says = []
5
6
 
6
7
  stub_run_for GitReflow
7
8
  stub_run_for GitReflow::Sandbox
@@ -18,6 +19,9 @@ module CommandLineHelpers
18
19
  $commands_ran << Hashie::Mash.new(command: command, options: options)
19
20
  command = "" # we need this due to a bug in rspec that will keep this assignment on subsequent runs of the stub
20
21
  end
22
+ module_to_stub.stub(:say) do |output, type|
23
+ $says << {message: output, type: type}
24
+ end
21
25
  end
22
26
 
23
27
  def reset_stubbed_command_line
@@ -84,6 +88,19 @@ RSpec::Matchers.define :have_run_commands_in_order do |commands|
84
88
  end
85
89
  end
86
90
 
91
+ RSpec::Matchers.define :have_said do |expected_message, expected_type|
92
+ match do |block|
93
+ block.call
94
+ $says.include?({message: expected_message, type: expected_type})
95
+ end
96
+
97
+ supports_block_expectations
98
+
99
+ failure_message do |block|
100
+ "expected GitReflow to have said #{expected_message} with #{expected_type.inspect} but didn't: \n\t#{$says.inspect}"
101
+ end
102
+ end
103
+
87
104
  RSpec::Matchers.define :have_output do |expected_output|
88
105
  match do |block|
89
106
  block.call
@@ -96,4 +113,3 @@ RSpec::Matchers.define :have_output do |expected_output|
96
113
  "expected STDOUT to include #{expected_output} but didn't: \n\t#{$output.inspect}"
97
114
  end
98
115
  end
99
-
@@ -53,20 +53,21 @@ module GithubHelpers
53
53
  github_server.class.stub(:oauth_token).and_return(oauth_token_hash.token)
54
54
  github_server.class.stub(:site_url).and_return(site_url)
55
55
  github_server.class.stub(:api_endpoint).and_return(api_endpoint)
56
- github_server.stub(:remote_user).and_return(user)
57
- github_server.stub(:remote_repo).and_return(repo)
58
- github_server.stub(:oauth_token).and_return(oauth_token_hash.token)
59
- github_server.stub(:get_commited_time).and_return(Time.now)
56
+ github_server.class.stub(:remote_user).and_return(user)
57
+ github_server.class.stub(:remote_repo).and_return(repo)
58
+ github_server.class.stub(:oauth_token).and_return(oauth_token_hash.token)
59
+ github_server.class.stub(:get_commited_time).and_return(Time.now)
60
60
 
61
61
  GitReflow.stub(:git_server).and_return(github_server)
62
62
 
63
63
  # Stubbing statuses for a given commit
64
+ stub_request(:get, %r{#{GitReflow.git_server.class.api_endpoint}/repos/#{user}/commits/\w+}).
65
+ to_return(:body => fixture('repositories/commit.json'), :status => 201, :headers => {:content_type => "application/json; charset=utf-8"})
64
66
  stub_request(:get, %r{#{GitReflow.git_server.class.api_endpoint}/repos/#{user}/commits/\w+/statuses?}).
65
67
  to_return(:body => fixture('pull_requests/pull_requests.json'), :status => 201, :headers => {:content_type => "application/json; charset=utf-8"})
66
68
 
67
69
  if pull
68
70
  # Stubbing review
69
- github.pull_requests.stub(:create).with(user, repo, pull.except('state')).and_return(Hashie::Mash.new(:number => '1', :title => pull['title'], :html_url => "https://github.com/#{user}/#{repo}/pulls/1"))
70
71
  stub_post("/repos/#{user}/#{repo}/pulls").
71
72
  to_return(:body => pull.to_s, :status => 201, :headers => {:content_type => "application/json\; charset=utf-8"})
72
73
 
@@ -76,10 +77,10 @@ module GithubHelpers
76
77
  stub_get("/repos/#{user}/#{repo}/pulls").with(:query => {'access_token' => 'a1b2c3d4e5f6g7h8i9j0', 'base' => 'master', 'head' => "#{user}:#{branch}", 'state' => 'open'}).
77
78
  to_return(:body => fixture('pull_requests/pull_requests.json'), :status => 201, :headers => {:content_type => "application/json; charset=utf-8"})
78
79
  # Stubbing pull request comments
79
- stub_get("/repos/#{user}/pulls/#{pull[:number]}/comments?").with(:query => {'access_token' => 'a1b2c3d4e5f6g7h8i9j0'}).
80
+ stub_get("/repos/#{user}/pulls/#{pull.number}/comments?").with(:query => {'access_token' => 'a1b2c3d4e5f6g7h8i9j0'}).
80
81
  to_return(:body => fixture('pull_requests/comments.json'), :status => 201, :headers => {:content_type => "application/json; charset=utf-8"})
81
82
  # Stubbing issue comments
82
- stub_get("/repos/#{user}/issues/#{pull[:number]}/comments?").with(:query => {'access_token' => 'a1b2c3d4e5f6g7h8i9j0'}).
83
+ stub_get("/repos/#{user}/issues/#{pull.number}/comments?").with(:query => {'access_token' => 'a1b2c3d4e5f6g7h8i9j0'}).
83
84
  to_return(:body => fixture('issues/comments.json'), :status => 201, :headers => {:content_type => "application/json; charset=utf-8"})
84
85
  end
85
86
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_reflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Valentino Stoll
@@ -10,8 +10,22 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-02-10 00:00:00.000000000 Z
13
+ date: 2015-03-26 00:00:00.000000000 Z
14
14
  dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: appraisal
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - '='
20
+ - !ruby/object:Gem::Version
21
+ version: 1.0.3
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - '='
27
+ - !ruby/object:Gem::Version
28
+ version: 1.0.3
15
29
  - !ruby/object:Gem::Dependency
16
30
  name: bundler
17
31
  requirement: !ruby/object:Gem::Requirement
@@ -96,6 +110,20 @@ dependencies:
96
110
  - - ">="
97
111
  - !ruby/object:Gem::Version
98
112
  version: '0'
113
+ - !ruby/object:Gem::Dependency
114
+ name: wwtd
115
+ requirement: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - '='
118
+ - !ruby/object:Gem::Version
119
+ version: 0.7.0
120
+ type: :development
121
+ prerelease: false
122
+ version_requirements: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - '='
125
+ - !ruby/object:Gem::Version
126
+ version: 0.7.0
99
127
  - !ruby/object:Gem::Dependency
100
128
  name: colorize
101
129
  requirement: !ruby/object:Gem::Requirement
@@ -180,6 +208,20 @@ dependencies:
180
208
  - - '='
181
209
  - !ruby/object:Gem::Version
182
210
  version: 0.12.3
211
+ - !ruby/object:Gem::Dependency
212
+ name: reenhanced_bitbucket_api
213
+ requirement: !ruby/object:Gem::Requirement
214
+ requirements:
215
+ - - '='
216
+ - !ruby/object:Gem::Version
217
+ version: 0.3.2
218
+ type: :runtime
219
+ prerelease: false
220
+ version_requirements: !ruby/object:Gem::Requirement
221
+ requirements:
222
+ - - '='
223
+ - !ruby/object:Gem::Version
224
+ version: 0.3.2
183
225
  description: Git Reflow manages your git workflow.
184
226
  email:
185
227
  - dev@reenhanced.com
@@ -191,6 +233,7 @@ extra_rdoc_files:
191
233
  - README.rdoc
192
234
  files:
193
235
  - ".gitignore"
236
+ - Appraisals
194
237
  - Gemfile
195
238
  - Gemfile.lock
196
239
  - LICENSE
@@ -198,6 +241,7 @@ files:
198
241
  - Rakefile
199
242
  - bin/git-reflow
200
243
  - bin/gitreflow-common
244
+ - circle.yml
201
245
  - git_reflow.gemspec
202
246
  - lib/git_reflow.rb
203
247
  - lib/git_reflow/base.rb
@@ -210,6 +254,7 @@ files:
210
254
  - lib/git_reflow/git_helpers.rb
211
255
  - lib/git_reflow/git_server.rb
212
256
  - lib/git_reflow/git_server/base.rb
257
+ - lib/git_reflow/git_server/bit_bucket.rb
213
258
  - lib/git_reflow/git_server/git_hub.rb
214
259
  - lib/git_reflow/sandbox.rb
215
260
  - lib/git_reflow/version.rb
@@ -219,11 +264,13 @@ files:
219
264
  - spec/fixtures/pull_requests/pull_request.json
220
265
  - spec/fixtures/pull_requests/pull_request_exists_error.json
221
266
  - spec/fixtures/pull_requests/pull_requests.json
267
+ - spec/fixtures/repositories/commit.json
222
268
  - spec/fixtures/repositories/statuses.json
223
269
  - spec/git_reflow_spec.rb
224
270
  - spec/lib/git_reflow/config_spec.rb
225
271
  - spec/lib/git_reflow/git_helpers_spec.rb
226
272
  - spec/lib/git_reflow/git_server_spec.rb
273
+ - spec/lib/git_server/bit_bucket_spec.rb
227
274
  - spec/lib/git_server/git_hub_spec.rb
228
275
  - spec/spec_helper.rb
229
276
  - spec/support/command_line_helpers.rb
@@ -259,7 +306,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
259
306
  version: '0'
260
307
  requirements: []
261
308
  rubyforge_project:
262
- rubygems_version: 2.4.3
309
+ rubygems_version: 2.4.6
263
310
  signing_key:
264
311
  specification_version: 4
265
312
  summary: A better git process
@@ -270,11 +317,13 @@ test_files:
270
317
  - spec/fixtures/pull_requests/pull_request.json
271
318
  - spec/fixtures/pull_requests/pull_request_exists_error.json
272
319
  - spec/fixtures/pull_requests/pull_requests.json
320
+ - spec/fixtures/repositories/commit.json
273
321
  - spec/fixtures/repositories/statuses.json
274
322
  - spec/git_reflow_spec.rb
275
323
  - spec/lib/git_reflow/config_spec.rb
276
324
  - spec/lib/git_reflow/git_helpers_spec.rb
277
325
  - spec/lib/git_reflow/git_server_spec.rb
326
+ - spec/lib/git_server/bit_bucket_spec.rb
278
327
  - spec/lib/git_server/git_hub_spec.rb
279
328
  - spec/spec_helper.rb
280
329
  - spec/support/command_line_helpers.rb