summaryrefslogtreecommitdiff
path: root/spec/services/web_hook_service_spec.rb
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-02-16 14:36:04 -0800
committerStan Hu <stanhu@gmail.com>2019-02-16 14:42:25 -0800
commitc220f300815bc9dbfe69debcbd8331fa193eeb9f (patch)
treea9298b38bab57cb124f3040d27d99c96d1c6a116 /spec/services/web_hook_service_spec.rb
parent28aa4d331c67fd3206858f57a30a3c14449216f3 (diff)
downloadgitlab-ce-c220f300815bc9dbfe69debcbd8331fa193eeb9f.tar.gz
Fix WebHookService spec failing in Ruby 2.6
Ruby 2.6 changed Net::ReadTimeout#message to include the reason for the socket error (https://bugs.ruby-lang.org/issues/14832). However, WebHookService was failing in Ruby 2.6 because it expected Exception#message to match Exception#to_s, which isn't always the case. Fix this by just checking Exception#to_s.
Diffstat (limited to 'spec/services/web_hook_service_spec.rb')
-rw-r--r--spec/services/web_hook_service_spec.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/services/web_hook_service_spec.rb b/spec/services/web_hook_service_spec.rb
index 5945a7dc0ad..747e04fb18c 100644
--- a/spec/services/web_hook_service_spec.rb
+++ b/spec/services/web_hook_service_spec.rb
@@ -102,7 +102,7 @@ describe WebHookService do
exception = exception_class.new('Exception message')
WebMock.stub_request(:post, project_hook.url).to_raise(exception)
- expect(service_instance.execute).to eq({ status: :error, message: exception.message })
+ expect(service_instance.execute).to eq({ status: :error, message: exception.to_s })
expect { service_instance.execute }.not_to raise_error
end
end