github.com/jingweno/gh@v2.1.1-0.20221007190738-04a7985fa9a1+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: No args, no upstream
    17      When I run `hub compare`
    18      Then the exit status should be 1
    19      And the stderr should contain:
    20        """
    21        git compare [-u] [USER] [<START>...]<END>
    22        """
    23  
    24    Scenario: Can't compare default branch to self
    25      Given the default branch for "origin" is "develop"
    26      And I am on the "develop" branch with upstream "origin/develop"
    27      When I run `hub compare`
    28      Then the exit status should be 1
    29      And the stderr should contain:
    30        """
    31        git compare [-u] [USER] [<START>...]<END>
    32        """
    33  
    34    Scenario: No args, has upstream branch
    35      Given I am on the "feature" branch with upstream "origin/experimental"
    36      And git "push.default" is set to "upstream"
    37      When I successfully run `hub compare`
    38      Then there should be no output
    39      And "open https://github.com/mislav/dotfiles/compare/experimental" should be run
    40  
    41    Scenario: Compare range
    42      When I successfully run `hub compare 1.0...fix`
    43      Then there should be no output
    44      And "open https://github.com/mislav/dotfiles/compare/1.0...fix" should be run
    45  
    46    Scenario: Output URL without opening the browser
    47      When I successfully run `hub compare -u 1.0...fix`
    48      Then "open https://github.com/mislav/dotfiles/compare/1.0...fix" should not be run
    49      And the stdout should contain exactly:
    50        """
    51        https://github.com/mislav/dotfiles/compare/1.0...fix\n
    52        """
    53  
    54    Scenario: Compare 2-dots range for tags
    55      When I successfully run `hub compare 1.0..fix`
    56      Then there should be no output
    57      And "open https://github.com/mislav/dotfiles/compare/1.0...fix" should be run
    58  
    59    Scenario: Compare 2-dots range for SHAs
    60      When I successfully run `hub compare 1234abc..3456cde`
    61      Then there should be no output
    62      And "open https://github.com/mislav/dotfiles/compare/1234abc...3456cde" should be run
    63  
    64    Scenario: Compare 2-dots range with "user:repo" notation
    65      When I successfully run `hub compare henrahmagix:master..2b10927`
    66      Then there should be no output
    67      And "open https://github.com/mislav/dotfiles/compare/henrahmagix:master...2b10927" should be run
    68  
    69    Scenario: Complex range is unchanged
    70      When I successfully run `hub compare @{a..b}..@{c..d}`
    71      Then there should be no output
    72      And "open https://github.com/mislav/dotfiles/compare/@{a..b}..@{c..d}" should be run
    73  
    74    Scenario: Compare wiki
    75      Given the "origin" remote has url "git://github.com/mislav/dotfiles.wiki.git"
    76      When I successfully run `hub compare 1.0..fix`
    77      Then there should be no output
    78      And "open https://github.com/mislav/dotfiles/wiki/_compare/1.0...fix" should be run
    79  
    80    Scenario: Compare fork
    81      When I successfully run `hub compare anotheruser feature`
    82      Then there should be no output
    83      And "open https://github.com/anotheruser/dotfiles/compare/feature" should be run