summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-09-01 19:04:27 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-09-01 19:04:27 +0300
commitfc16836764e9712a8f8d5b8ff844ae7512e08a82 (patch)
treead3e9d22875c8487c556707712d1252fbd4a0f65
parent119aae7d71cac17af9a68122c8b3021adf5cbfd9 (diff)
downloadgitlab-shell-fc16836764e9712a8f8d5b8ff844ae7512e08a82.tar.gz
Add tests for GitlabPostReceive
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r--spec/gitlab_access_spec.rb3
-rw-r--r--spec/gitlab_post_receive_spec.rb18
2 files changed, 20 insertions, 1 deletions
diff --git a/spec/gitlab_access_spec.rb b/spec/gitlab_access_spec.rb
index 81de152..13db4bd 100644
--- a/spec/gitlab_access_spec.rb
+++ b/spec/gitlab_access_spec.rb
@@ -5,7 +5,7 @@ describe GitlabAccess do
let(:repository_path) { "/home/git/repositories" }
let(:repo_name) { 'dzaporozhets/gitlab-ci' }
let(:repo_path) { File.join(repository_path, repo_name) + ".git" }
- let(:gitlab_access) { GitlabAccess.new(repo_path, 'key-123', '') }
+ let(:gitlab_access) { GitlabAccess.new(repo_path, 'key-123', 'wow') }
before do
GitlabConfig.any_instance.stub(repos_path: repository_path)
@@ -14,5 +14,6 @@ describe GitlabAccess do
describe :initialize do
it { gitlab_access.repo_name.should == repo_name }
it { gitlab_access.repo_path.should == repo_path }
+ it { gitlab_access.changes.should == ['wow'] }
end
end
diff --git a/spec/gitlab_post_receive_spec.rb b/spec/gitlab_post_receive_spec.rb
new file mode 100644
index 0000000..a9a4e13
--- /dev/null
+++ b/spec/gitlab_post_receive_spec.rb
@@ -0,0 +1,18 @@
+require 'spec_helper'
+require 'gitlab_post_receive'
+
+describe GitlabPostReceive do
+ let(:repository_path) { "/home/git/repositories" }
+ let(:repo_name) { 'dzaporozhets/gitlab-ci' }
+ let(:repo_path) { File.join(repository_path, repo_name) + ".git" }
+ let(:gitlab_post_receive) { GitlabPostReceive.new(repo_path, 'key-123', 'wow') }
+
+ before do
+ GitlabConfig.any_instance.stub(repos_path: repository_path)
+ end
+
+ describe :initialize do
+ it { gitlab_post_receive.repo_path.should == repo_path }
+ it { gitlab_post_receive.changes.should == ['wow'] }
+ end
+end