diff options
| author | Alejandro RodrÃguez <alejorro70@gmail.com> | 2017-10-09 18:25:24 -0300 |
|---|---|---|
| committer | Alejandro RodrÃguez <alejorro70@gmail.com> | 2017-10-09 18:25:24 -0300 |
| commit | 1731934398aedfec89ad006818b55641dc1f789c (patch) | |
| tree | 46a552cf01c7b0b7deb85a31c48369e443649f16 /spec | |
| parent | d6170ce4d8a0cbfd8552531c29163e44549222cf (diff) | |
| download | gitlab-ce-1731934398aedfec89ad006818b55641dc1f789c.tar.gz | |
Add `Gitlab::Git::Repository#fetch` commandgitaly-fetch-remote
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/lib/gitlab/git/repository_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/lib/gitlab/git/repository_spec.rb b/spec/lib/gitlab/git/repository_spec.rb index 1ee4acfd193..ca3b6cc2d73 100644 --- a/spec/lib/gitlab/git/repository_spec.rb +++ b/spec/lib/gitlab/git/repository_spec.rb @@ -1489,6 +1489,21 @@ describe Gitlab::Git::Repository, seed_helper: true do end end + describe '#fetch' do + let(:git_path) { Gitlab.config.git.bin_path } + let(:remote_name) { 'my_remote' } + + subject { repository.fetch(remote_name) } + + it 'fetches the remote and returns true if the command was successful' do + expect(repository).to receive(:popen) + .with(%W(#{git_path} fetch #{remote_name}), repository.path) + .and_return(['', 0]) + + expect(subject).to be(true) + end + end + def create_remote_branch(repository, remote_name, branch_name, source_branch_name) source_branch = repository.branches.find { |branch| branch.name == source_branch_name } rugged = repository.rugged |
