Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 67 lines (61 sloc) 2.149 kb
4719f39 @mislav simplify and better document `hub merge` command
mislav authored
1 Feature: hub merge
2 Background:
3 Given I am in "hub" git repo
4 And the "origin" remote has url "git://github.com/defunkt/hub.git"
5 And I am "mislav" on github.com with OAuth token "OTOKEN"
6
7 Scenario: Merge pull request
8 Given the GitHub API server:
9 """
10 require 'json'
efff54b @mislav smart JSON handling in local Sinatra app
mislav authored
11 get('/repos/defunkt/hub/pulls/164') { body \
4719f39 @mislav simplify and better document `hub merge` command
mislav authored
12 :head => {
13 :label => 'jfirebaugh:hub_merge',
14 :repo => {:private => false}
15 },
16 :title => "Add `hub merge` command"
17 }
18 """
19 And there is a commit named "jfirebaugh/hub_merge"
20 When I successfully run `hub merge https://github.com/defunkt/hub/pull/164`
21 Then "git fetch git://github.com/jfirebaugh/hub.git +refs/heads/hub_merge:refs/remotes/jfirebaugh/hub_merge" should be run
22 When I successfully run `git show -s --format=%B`
23 Then the output should contain:
24 """
25 Merge pull request #164 from jfirebaugh/hub_merge
26
27 Add `hub merge` command
28 """
29
30 Scenario: Merge pull request
31 Given the GitHub API server:
32 """
33 require 'json'
efff54b @mislav smart JSON handling in local Sinatra app
mislav authored
34 get('/repos/defunkt/hub/pulls/164') { body \
4719f39 @mislav simplify and better document `hub merge` command
mislav authored
35 :head => {
36 :label => 'jfirebaugh:hub_merge',
37 :repo => {:private => true}
38 },
39 :title => "Add `hub merge` command"
40 }
41 """
42 And there is a commit named "jfirebaugh/hub_merge"
43 When I successfully run `hub merge https://github.com/defunkt/hub/pull/164`
44 Then "git fetch git@github.com:jfirebaugh/hub.git +refs/heads/hub_merge:refs/remotes/jfirebaugh/hub_merge" should be run
45
46 Scenario: Missing repo
47 Given the GitHub API server:
48 """
49 require 'json'
efff54b @mislav smart JSON handling in local Sinatra app
mislav authored
50 get('/repos/defunkt/hub/pulls/164') { body \
4719f39 @mislav simplify and better document `hub merge` command
mislav authored
51 :head => {
52 :label => 'jfirebaugh:hub_merge',
53 :repo => nil
54 }
55 }
56 """
57 When I run `hub merge https://github.com/defunkt/hub/pull/164`
58 Then the exit status should be 1
59 And the stderr should contain exactly:
60 """
61 Error: jfirebaugh's fork is not available anymore\n
62 """
63
64 Scenario: Unchanged merge
65 When I run `hub merge master`
66 Then "git merge master" should be run
Something went wrong with that request. Please try again.