github.com/echohead/hub@v2.2.1+incompatible/features/clone.feature (about)

     1  Feature: hub clone
     2    Background:
     3      Given I am "mislav" on github.com with OAuth token "OTOKEN"
     4  
     5    Scenario: Clone a public repo
     6      Given the GitHub API server:
     7        """
     8        get('/repos/rtomayko/ronn') {
     9          json :private => false,
    10               :permissions => { :push => false }
    11        }
    12        """
    13      When I successfully run `hub clone rtomayko/ronn`
    14      Then it should clone "git://github.com/rtomayko/ronn.git"
    15      And there should be no output
    16  
    17    Scenario: Clone a public repo with period in name
    18      Given the GitHub API server:
    19        """
    20        get('/repos/hookio/hook.js') {
    21          json :private => false,
    22               :permissions => { :push => false }
    23        }
    24        """
    25      When I successfully run `hub clone hookio/hook.js`
    26      Then it should clone "git://github.com/hookio/hook.js.git"
    27      And there should be no output
    28  
    29    Scenario: Clone a public repo that starts with a period
    30      Given the GitHub API server:
    31        """
    32        get('/repos/zhuangya/.vim') {
    33          json :private => false,
    34               :permissions => { :push => false }
    35        }
    36        """
    37      When I successfully run `hub clone zhuangya/.vim`
    38      Then it should clone "git://github.com/zhuangya/.vim.git"
    39      And there should be no output
    40  
    41    Scenario: Clone a public repo with HTTPS
    42      Given HTTPS is preferred
    43      When I successfully run `hub clone rtomayko/ronn`
    44      Then it should clone "https://github.com/rtomayko/ronn.git"
    45      And there should be no output
    46  
    47    Scenario: Clone command aliased
    48      Given the GitHub API server:
    49        """
    50        get('/repos/rtomayko/ronn') {
    51          json :private => false,
    52               :permissions => { :push => false }
    53        }
    54        """
    55      When I successfully run `git config --global alias.c "clone --bare"`
    56      And I successfully run `hub c rtomayko/ronn`
    57      Then "git clone --bare git://github.com/rtomayko/ronn.git" should be run
    58      And there should be no output
    59  
    60    Scenario: Unchanged public clone
    61      When I successfully run `hub clone git://github.com/rtomayko/ronn.git`
    62      Then the git command should be unchanged
    63  
    64    Scenario: Unchanged public clone with path
    65      When I successfully run `hub clone git://github.com/rtomayko/ronn.git ronnie`
    66      Then the git command should be unchanged
    67      And there should be no output
    68  
    69    Scenario: Unchanged private clone
    70      When I successfully run `hub clone git@github.com:rtomayko/ronn.git`
    71      Then the git command should be unchanged
    72      And there should be no output
    73  
    74    Scenario: Unchanged clone with complex arguments
    75      When I successfully run `hub clone --template=one/two git://github.com/defunkt/resque.git --origin master resquetastic`
    76      Then the git command should be unchanged
    77      And there should be no output
    78  
    79    Scenario: Unchanged local clone
    80      When I successfully run `hub clone ./dotfiles`
    81      Then the git command should be unchanged
    82      And there should be no output
    83  
    84    Scenario: Unchanged local clone with destination
    85      When I successfully run `hub clone -l . ../copy`
    86      Then the git command should be unchanged
    87      And there should be no output
    88  
    89    Scenario: Unchanged clone with host alias
    90      When I successfully run `hub clone shortcut:git/repo.git`
    91      Then the git command should be unchanged
    92      And there should be no output
    93  
    94    Scenario: Preview cloning a private repo
    95      When I successfully run `hub --noop clone -p rtomayko/ronn`
    96      Then the output should contain exactly "git clone git@github.com:rtomayko/ronn.git\n"
    97      But it should not clone anything
    98  
    99    Scenario: Clone a private repo
   100      When I successfully run `hub clone -p rtomayko/ronn`
   101      Then it should clone "git@github.com:rtomayko/ronn.git"
   102      And there should be no output
   103  
   104    Scenario: Clone my repo
   105      Given the GitHub API server:
   106        """
   107        get('/repos/mislav/dotfiles') {
   108          json :private => false,
   109               :permissions => { :push => true }
   110        }
   111        """
   112      When I successfully run `hub clone dotfiles`
   113      Then it should clone "git@github.com:mislav/dotfiles.git"
   114      And there should be no output
   115  
   116    Scenario: Clone my repo with arguments
   117      Given the GitHub API server:
   118        """
   119        get('/repos/mislav/dotfiles') {
   120          json :private => false,
   121               :permissions => { :push => true }
   122        }
   123        """
   124      When I successfully run `hub clone --bare -o master dotfiles`
   125      Then "git clone --bare -o master git@github.com:mislav/dotfiles.git" should be run
   126      And there should be no output
   127  
   128    Scenario: Clone repo to which I have push access to
   129      Given the GitHub API server:
   130        """
   131        get('/repos/sstephenson/rbenv') {
   132          json :private => false,
   133               :permissions => { :push => true }
   134        }
   135        """
   136      When I successfully run `hub clone sstephenson/rbenv`
   137      Then "git clone git@github.com:sstephenson/rbenv.git" should be run
   138      And there should be no output
   139  
   140    Scenario: Preview cloning a repo I have push access to
   141      Given the GitHub API server:
   142        """
   143        get('/repos/sstephenson/rbenv') {
   144          json :private => false,
   145               :permissions => { :push => true }
   146        }
   147        """
   148      When I successfully run `hub --noop clone sstephenson/rbenv`
   149      Then the output should contain exactly "git clone git@github.com:sstephenson/rbenv.git\n"
   150      But it should not clone anything
   151  
   152    Scenario: Clone my Enterprise repo
   153      Given I am "mifi" on git.my.org with OAuth token "FITOKEN"
   154      And $GITHUB_HOST is "git.my.org"
   155      Given the GitHub API server:
   156        """
   157        get('/api/v3/repos/myorg/myrepo') {
   158          json :private => true,
   159               :permissions => { :push => false }
   160        }
   161        """
   162      When I successfully run `hub clone myorg/myrepo`
   163      Then it should clone "git@git.my.org:myorg/myrepo.git"
   164      And there should be no output
   165  
   166    Scenario: Clone from existing directory is a local clone
   167      Given a directory named "dotfiles"
   168      When I successfully run `hub clone dotfiles`
   169      Then the git command should be unchanged
   170      And there should be no output
   171  
   172    Scenario: Clone a wiki
   173      Given the GitHub API server:
   174        """
   175        get('/repos/rtomayko/ronn') {
   176          json :private => false,
   177               :permissions => { :push => false }
   178        }
   179        """
   180      When I successfully run `hub clone rtomayko/ronn.wiki`
   181      Then it should clone "git://github.com/rtomayko/ronn.wiki.git"
   182      And there should be no output