You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying the "webmock/minitest". Here is the test code:
assert_raises DirectLink::ErrorNotFound do
DirectLink.imgur "https://imgur.com/a/wwwwwww"
end
As I remember the "You can stub this request with ..." has to be formatted well so I could copypaste it. But probably due to the assert_raise block it does not format well:
1) Failure:
DirectLink::./lib::imgur#test_0004_ErrorNotFound when album is empty [unit.test.rb:252]:
[DirectLink::ErrorNotFound] exception expected, not
Class: <WebMock::NetConnectNotAllowedError>
Message: <"Real HTTP connections are disabled. Unregistered request: HEAD https://api.imgur.com/3/album/wwwwwww/0.json with headers {'Accept'=>'*/*', 'Authorization'=>'Client-ID 00000', 'Host'=>'api.imgur.com', 'User-Agent'=>'Ruby'}\n\nYou can stub this request with the following snippet:\n\nstub_request(:head, \"https://api.imgur.com/3/album/wwwwwww/0.json\").\n with(\n headers: {\n\t 'Accept'=>'*/*',\n\t 'Authorization'=>'Client-ID 00000',\n\t 'Host'=>'api.imgur.com',\n\t 'User-Agent'=>'Ruby'\n }).\n to_return(status: 200, body: \"\", headers: {})\n\n============================================================">
---Backtrace---
/Users/nakilon/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/webmock-3.11.0/lib/webmock/http_lib_adapters/net_http.rb:114:in `request'
...
Or did I forgot something I had to add to make it look good?
The text was updated successfully, but these errors were encountered:
@Nakilon the WebMock::NetConnectNotAllowedError exception is not supposed to be caught by assert_raises, but instead caught as a test error and unchanged message printed.
Trying the "webmock/minitest". Here is the test code:
As I remember the "You can stub this request with ..." has to be formatted well so I could copypaste it. But probably due to the
assert_raise
block it does not format well:Or did I forgot something I had to add to make it look good?
The text was updated successfully, but these errors were encountered: