summaryrefslogtreecommitdiff
path: root/spec/gitlab_custom_hook_spec.rb
diff options
context:
space:
mode:
authorDirk Hörner <dirker@gmail.com>2016-09-05 11:59:25 +0200
committerSean McGivern <sean@gitlab.com>2016-12-01 11:40:11 +0000
commitd05522de85dcdfa91349c0d9fc78bf72931d6a39 (patch)
tree30326e051959be5a7ddf6539b3c63fa48aa7330c /spec/gitlab_custom_hook_spec.rb
parent2d774eeae8ccfb211cc6ab6aeab5db600f3fdc7c (diff)
downloadgitlab-shell-d05522de85dcdfa91349c0d9fc78bf72931d6a39.tar.gz
custom_hook: refactor to pull repo_path into class
This commit takes the GitlabCustomHook a bit clother to the other hook handling classes by receiving the repo_path as argument to initialize() instead of passing it to each method.
Diffstat (limited to 'spec/gitlab_custom_hook_spec.rb')
-rw-r--r--spec/gitlab_custom_hook_spec.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/gitlab_custom_hook_spec.rb b/spec/gitlab_custom_hook_spec.rb
index f93c8b4..328b925 100644
--- a/spec/gitlab_custom_hook_spec.rb
+++ b/spec/gitlab_custom_hook_spec.rb
@@ -4,14 +4,14 @@ require 'pry'
require 'gitlab_custom_hook'
describe GitlabCustomHook do
- let(:gitlab_custom_hook) { GitlabCustomHook.new('key_1') }
+ let(:gitlab_custom_hook) { GitlabCustomHook.new('repo_path', 'key_1') }
let(:hook_path) { File.join(ROOT_PATH, 'spec/support/gl_id_test_hook') }
context 'pre_receive hook' do
it 'passes GL_ID variable to hook' do
allow(gitlab_custom_hook).to receive(:hook_file).and_return(hook_path)
- expect(gitlab_custom_hook.pre_receive('changes', 'repo_path')).to be_true
+ expect(gitlab_custom_hook.pre_receive('changes')).to be_true
end
end
@@ -19,7 +19,7 @@ describe GitlabCustomHook do
it 'passes GL_ID variable to hook' do
allow(gitlab_custom_hook).to receive(:hook_file).and_return(hook_path)
- expect(gitlab_custom_hook.post_receive('changes', 'repo_path')).to be_true
+ expect(gitlab_custom_hook.post_receive('changes')).to be_true
end
end
@@ -27,7 +27,7 @@ describe GitlabCustomHook do
it 'passes GL_ID variable to hook' do
allow(gitlab_custom_hook).to receive(:hook_file).and_return(hook_path)
- expect(gitlab_custom_hook.update('master', '', '', 'repo_path')).to be_true
+ expect(gitlab_custom_hook.update('master', '', '')).to be_true
end
end
end