summaryrefslogtreecommitdiff
path: root/spec/services
diff options
context:
space:
mode:
authorRubén Dávila <ruben@gitlab.com>2015-12-01 12:31:44 -0500
committerRubén Dávila <ruben@gitlab.com>2015-12-03 09:39:15 -0500
commit5e6a5270d52ea2f13ca9967913012691e257439b (patch)
tree676ccf4b9c1b21b2522cc0b7adf4a9985e04b1fe /spec/services
parent338eb2c41ea766779d6bb7798079a1dd3a50e11d (diff)
downloadgitlab-ce-5e6a5270d52ea2f13ca9967913012691e257439b.tar.gz
Raise the exception from #execute instead of #run_hook. #1156 #3069issue_1156
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/git_hooks_service_spec.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/services/git_hooks_service_spec.rb b/spec/services/git_hooks_service_spec.rb
index bb639a5ae23..7e018d3c9fe 100644
--- a/spec/services/git_hooks_service_spec.rb
+++ b/spec/services/git_hooks_service_spec.rb
@@ -31,7 +31,9 @@ describe GitHooksService do
expect(service).to receive(:run_hook).with('pre-receive').and_return(false)
expect(service).not_to receive(:run_hook).with('post-receive')
- service.execute(user, @repo_path, @blankrev, @newrev, @ref)
+ expect do
+ service.execute(user, @repo_path, @blankrev, @newrev, @ref)
+ end.to raise_error(GitHooksService::PreReceiveError)
end
end
@@ -41,7 +43,9 @@ describe GitHooksService do
expect(service).to receive(:run_hook).with('update').and_return(false)
expect(service).not_to receive(:run_hook).with('post-receive')
- service.execute(user, @repo_path, @blankrev, @newrev, @ref)
+ expect do
+ service.execute(user, @repo_path, @blankrev, @newrev, @ref)
+ end.to raise_error(GitHooksService::PreReceiveError)
end
end