github.com/pengwynn/gh@v1.0.1-0.20140118055701-14327ca3942e/features/merge.feature (about) 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' 11 get('/repos/defunkt/hub/pulls/164') { json \ 12 :head => { 13 :label => 'jfirebaugh:hub_merge', 14 :repo => {:id => 1, :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 with --ff-only option 31 Given the GitHub API server: 32 """ 33 require 'json' 34 get('/repos/defunkt/hub/pulls/164') { json \ 35 :head => { 36 :label => 'jfirebaugh:hub_merge', 37 :repo => {:id => 1, :private => false} 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 --ff-only 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 When I successfully run `git show -s --format=%B` 46 Then the output should contain: 47 """ 48 Fast-forward (no commit created; -m option ignored) 49 """ 50 51 Scenario: Merge private pull request 52 Given the GitHub API server: 53 """ 54 require 'json' 55 get('/repos/defunkt/hub/pulls/164') { json \ 56 :head => { 57 :label => 'jfirebaugh:hub_merge', 58 :repo => {:id => 1, :private => true} 59 }, 60 :title => "Add `hub merge` command" 61 } 62 """ 63 And there is a commit named "jfirebaugh/hub_merge" 64 When I successfully run `hub merge https://github.com/defunkt/hub/pull/164` 65 Then "git fetch git@github.com:jfirebaugh/hub.git +refs/heads/hub_merge:refs/remotes/jfirebaugh/hub_merge" should be run 66 67 Scenario: Missing repo 68 Given the GitHub API server: 69 """ 70 require 'json' 71 get('/repos/defunkt/hub/pulls/164') { json \ 72 :head => { 73 :label => 'jfirebaugh:hub_merge', 74 :repo => nil 75 } 76 } 77 """ 78 When I run `hub merge https://github.com/defunkt/hub/pull/164` 79 Then the exit status should be 1 80 And the stderr should contain exactly: 81 """ 82 Error: jfirebaugh's fork is not available anymore\n 83 """ 84 85 Scenario: Unchanged merge 86 When I run `hub merge master` 87 Then "git merge master" should be run