Commit c220f300 authored by Stan Hu's avatar Stan Hu

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.
parent 28aa4d33
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment