github.com/pengwynn/gh@v1.0.1-0.20140118055701-14327ca3942e/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 clone -p rtomayko/ronn --noop` 96 Then the output should contain exactly "git clone git@github.com:rtomayko/ronn.git\n" 97 But "git clone" should not be run 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 @wip 129 Scenario: Clone repo to which I have push access to 130 Given the GitHub API server: 131 """ 132 get('/repos/sstephenson/rbenv') { 133 json :private => false, 134 :permissions => { :push => true } 135 } 136 """ 137 When I successfully run `hub clone sstephenson/rbenv` 138 Then "git clone git@github.com:sstephenson/rbenv.git" should be run 139 And there should be no output 140 141 @wip 142 Scenario: Clone my Enterprise repo 143 Given I am "mifi" on git.my.org with OAuth token "FITOKEN" 144 And $GITHUB_HOST is "git.my.org" 145 Given the GitHub API server: 146 """ 147 get('/api/v3/repos/myorg/myrepo') { 148 json :private => true, 149 :permissions => { :push => false } 150 } 151 """ 152 When I successfully run `hub clone myorg/myrepo` 153 Then it should clone "git@git.my.org:myorg/myrepo.git" 154 And there should be no output 155 156 Scenario: Clone from existing directory is a local clone 157 Given a directory named "dotfiles" 158 When I successfully run `hub clone dotfiles` 159 Then the git command should be unchanged 160 And there should be no output 161