diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-08-13 11:33:14 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-08-13 11:33:14 +0300 |
commit | b6ec27d941ab7d2674d5479f196b9b647ff246dc (patch) | |
tree | 64b75e3653ce26e1fa82990761d7fa3cca23d1e1 /spec/gitlab_update_spec.rb | |
parent | 59bffe6b1ed6ed425723cf6d98259bdee9f75f0a (diff) | |
download | gitlab-shell-b6ec27d941ab7d2674d5479f196b9b647ff246dc.tar.gz |
Fix invalid repo_name/repo_path parsing by GitlabUpdate
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec/gitlab_update_spec.rb')
-rw-r--r-- | spec/gitlab_update_spec.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/gitlab_update_spec.rb b/spec/gitlab_update_spec.rb new file mode 100644 index 0000000..580d8c9 --- /dev/null +++ b/spec/gitlab_update_spec.rb @@ -0,0 +1,25 @@ +require 'spec_helper' +require 'gitlab_update' + +describe GitlabUpdate do + let(:repository_path) { "/home/git/repositories" } + let(:repo_name) { 'dzaporozhets/gitlab-ci' } + let(:repo_path) { File.join(repository_path, repo_name) + ".git" } + let(:ref) { 'refs/heads/awesome-feature' } + let(:gitlab_update) { GitlabUpdate.new(repo_path, 'key-123', ref) } + + before do + ARGV[1] = 'd1e3ca3b25' + ARGV[2] = 'c2b3653b25' + GitlabConfig.any_instance.stub(repos_path: repository_path) + end + + describe :initialize do + it { gitlab_update.repo_name.should == repo_name } + it { gitlab_update.repo_path.should == repo_path } + it { gitlab_update.ref.should == ref } + it { gitlab_update.ref_name.should == 'awesome-feature' } + it { gitlab_update.oldrev.should == 'd1e3ca3b25' } + it { gitlab_update.newrev.should == 'c2b3653b25' } + end +end |