github.com/scorpionis/hub@v2.2.1+incompatible/features/am.feature (about)

     1  Feature: hub am
     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: Apply a local patch
     7      When I run `hub am some.patch`
     8      Then the git command should be unchanged
     9  
    10    Scenario: Apply commits from pull request
    11      Given the GitHub API server:
    12        """
    13        get('/repos/mislav/dotfiles/pulls/387') {
    14          halt 400 unless request.env['HTTP_ACCEPT'] == 'application/vnd.github.v3.patch;charset=utf-8'
    15          generate_patch "Create a README"
    16        }
    17        """
    18      When I successfully run `hub am -q -3 https://github.com/mislav/dotfiles/pull/387`
    19      Then there should be no output
    20      Then the latest commit message should be "Create a README"
    21  
    22    Scenario: Apply commits when TMPDIR is empty
    23      Given $TMPDIR is ""
    24      Given the GitHub API server:
    25        """
    26        get('/repos/mislav/dotfiles/pulls/387') {
    27          halt 400 unless request.env['HTTP_ACCEPT'] == 'application/vnd.github.v3.patch;charset=utf-8'
    28          generate_patch "Create a README"
    29        }
    30        """
    31      When I successfully run `hub am -q https://github.com/mislav/dotfiles/pull/387`
    32      Then the latest commit message should be "Create a README"
    33  
    34    Scenario: Enterprise repo
    35      Given I am in "git://git.my.org/mislav/dotfiles.git" git repo
    36      And I am "mislav" on git.my.org with OAuth token "FITOKEN"
    37      And "git.my.org" is a whitelisted Enterprise host
    38      Given the GitHub API server:
    39        """
    40        get('/api/v3/repos/mislav/dotfiles/pulls/387') {
    41          halt 400 unless request.env['HTTP_ACCEPT'] == 'application/vnd.github.v3.patch;charset=utf-8'
    42          generate_patch "Create a README"
    43        }
    44        """
    45      When I successfully run `hub am -q -3 https://git.my.org/mislav/dotfiles/pull/387`
    46      Then the latest commit message should be "Create a README"
    47  
    48    Scenario: Apply patch from commit
    49      Given the GitHub API server:
    50        """
    51        get('/repos/davidbalbert/dotfiles/commits/fdb9921') {
    52          halt 400 unless request.env['HTTP_ACCEPT'] == 'application/vnd.github.v3.patch;charset=utf-8'
    53          generate_patch "Create a README"
    54        }
    55        """
    56      When I successfully run `hub am -q https://github.com/davidbalbert/dotfiles/commit/fdb9921`
    57      Then the latest commit message should be "Create a README"
    58  
    59    Scenario: Apply patch from gist
    60      Given the GitHub API server:
    61        """
    62        get('/gists/8da7fb575debd88c54cf', :host_name => 'api.github.com') {
    63          json :files => {
    64            'file.diff' => {
    65              :raw_url => "https://gist.github.com/raw/8da7fb575debd88c54cf/SHA/file.diff"
    66            }
    67          }
    68        }
    69        get('/raw/8da7fb575debd88c54cf/SHA/file.diff', :host_name => 'gist.github.com') {
    70          halt 400 unless request.env['HTTP_ACCEPT'] == 'text/plain;charset=utf-8'
    71          generate_patch "Create a README"
    72        }
    73        """
    74      When I successfully run `hub am -q https://gist.github.com/8da7fb575debd88c54cf`
    75      Then the latest commit message should be "Create a README"