Skip to content

Commit fc16836

Browse files
committed
Add tests for GitlabPostReceive
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
1 parent 119aae7 commit fc16836

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

spec/gitlab_access_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
let(:repository_path) { "/home/git/repositories" }
66
let(:repo_name) { 'dzaporozhets/gitlab-ci' }
77
let(:repo_path) { File.join(repository_path, repo_name) + ".git" }
8-
let(:gitlab_access) { GitlabAccess.new(repo_path, 'key-123', '') }
8+
let(:gitlab_access) { GitlabAccess.new(repo_path, 'key-123', 'wow') }
99

1010
before do
1111
GitlabConfig.any_instance.stub(repos_path: repository_path)
@@ -14,5 +14,6 @@
1414
describe :initialize do
1515
it { gitlab_access.repo_name.should == repo_name }
1616
it { gitlab_access.repo_path.should == repo_path }
17+
it { gitlab_access.changes.should == ['wow'] }
1718
end
1819
end

spec/gitlab_post_receive_spec.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
require 'spec_helper'
2+
require 'gitlab_post_receive'
3+
4+
describe GitlabPostReceive do
5+
let(:repository_path) { "/home/git/repositories" }
6+
let(:repo_name) { 'dzaporozhets/gitlab-ci' }
7+
let(:repo_path) { File.join(repository_path, repo_name) + ".git" }
8+
let(:gitlab_post_receive) { GitlabPostReceive.new(repo_path, 'key-123', 'wow') }
9+
10+
before do
11+
GitlabConfig.any_instance.stub(repos_path: repository_path)
12+
end
13+
14+
describe :initialize do
15+
it { gitlab_post_receive.repo_path.should == repo_path }
16+
it { gitlab_post_receive.changes.should == ['wow'] }
17+
end
18+
end

0 commit comments

Comments
 (0)