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.
This commit is contained in:
parent
28aa4d331c
commit
c220f30081
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue