github.com/scorpionis/hub@v2.2.1+incompatible/features/compare.feature (about) 1 Feature: hub compare 2 Background: 3 Given I am in "git://github.com/mislav/dotfiles.git" git repo 4 And I am "mislav" on github.com with OAuth token "OTOKEN" 5 6 Scenario: Compare branch 7 When I successfully run `hub compare refactor` 8 Then there should be no output 9 And "open https://github.com/mislav/dotfiles/compare/refactor" should be run 10 11 Scenario: Compare complex branch 12 When I successfully run `hub compare feature/foo` 13 Then there should be no output 14 And "open https://github.com/mislav/dotfiles/compare/feature/foo" should be run 15 16 Scenario: Compare branch with funky characters 17 When I successfully run `hub compare 'my#branch!with.special+chars'` 18 Then there should be no output 19 And "open https://github.com/mislav/dotfiles/compare/my%23branch!with.special%2Bchars" should be run 20 21 Scenario: No args, no upstream 22 When I run `hub compare` 23 Then the exit status should be 1 24 And the stderr should contain: 25 """ 26 hub compare [USER] [<START>...]<END> 27 """ 28 29 Scenario: Can't compare default branch to self 30 Given the default branch for "origin" is "develop" 31 And I am on the "develop" branch with upstream "origin/develop" 32 When I run `hub compare` 33 Then the exit status should be 1 34 And the stderr should contain: 35 """ 36 hub compare [USER] [<START>...]<END> 37 """ 38 39 Scenario: No args, has upstream branch 40 Given I am on the "feature" branch with upstream "origin/experimental" 41 And git "push.default" is set to "upstream" 42 When I successfully run `hub compare` 43 Then there should be no output 44 And "open https://github.com/mislav/dotfiles/compare/experimental" should be run 45 46 Scenario: Current branch has funky characters 47 Given I am on the "feature" branch with upstream "origin/my#branch!with.special+chars" 48 And git "push.default" is set to "upstream" 49 When I successfully run `hub compare` 50 Then there should be no output 51 And "open https://github.com/mislav/dotfiles/compare/my%23branch!with.special%2Bchars" should be run 52 53 Scenario: Compare range 54 When I successfully run `hub compare 1.0...fix` 55 Then there should be no output 56 And "open https://github.com/mislav/dotfiles/compare/1.0...fix" should be run 57 58 Scenario: Output URL without opening the browser 59 When I successfully run `hub compare -u 1.0...fix` 60 Then "open https://github.com/mislav/dotfiles/compare/1.0...fix" should not be run 61 And the stdout should contain exactly: 62 """ 63 https://github.com/mislav/dotfiles/compare/1.0...fix\n 64 """ 65 66 Scenario: Compare 2-dots range for tags 67 When I successfully run `hub compare 1.0..fix` 68 Then there should be no output 69 And "open https://github.com/mislav/dotfiles/compare/1.0...fix" should be run 70 71 Scenario: Compare 2-dots range for SHAs 72 When I successfully run `hub compare 1234abc..3456cde` 73 Then there should be no output 74 And "open https://github.com/mislav/dotfiles/compare/1234abc...3456cde" should be run 75 76 Scenario: Compare 2-dots range with "user:repo" notation 77 When I successfully run `hub compare henrahmagix:master..2b10927` 78 Then there should be no output 79 And "open https://github.com/mislav/dotfiles/compare/henrahmagix:master...2b10927" should be run 80 81 Scenario: Complex range is unchanged 82 When I successfully run `hub compare @{a..b}..@{c..d}` 83 Then there should be no output 84 And "open https://github.com/mislav/dotfiles/compare/@{a..b}..@{c..d}" should be run 85 86 Scenario: Compare wiki 87 Given the "origin" remote has url "git://github.com/mislav/dotfiles.wiki.git" 88 When I successfully run `hub compare 1.0..fix` 89 Then there should be no output 90 And "open https://github.com/mislav/dotfiles/wiki/_compare/1.0...fix" should be run 91 92 Scenario: Compare fork 93 When I successfully run `hub compare anotheruser feature` 94 Then there should be no output 95 And "open https://github.com/anotheruser/dotfiles/compare/feature" should be run 96 97 Scenario: Enterprise repo over HTTP 98 Given the "origin" remote has url "git://git.my.org/mislav/dotfiles.git" 99 And I am "mislav" on http://git.my.org with OAuth token "FITOKEN" 100 And "git.my.org" is a whitelisted Enterprise host 101 When I successfully run `hub compare refactor` 102 Then there should be no output 103 And "open http://git.my.org/mislav/dotfiles/compare/refactor" should be run