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