Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- their_site = 'http://rest.example.com'
- stub_request(:any, /#{their_site}.*/ ).to_raise(Errno::ECONNREFUSED)
- their_site = 'https://rest.example.com:443/api'
- stub_request(:any, %r[#{their_site}.*] ).to_timeout
- stub_request(:any, %r[#{their_site}.*] )
- .to_return(status: 500, body: 'Sorry, mate.')
- stub_request(:any, %r[#{their_site}.*] )
- .to_return(status: 404)
- stub_request(:any, %r[#{their_site}.*] )
- .to_return(status: 200, 'We tried our best.')
- stub_request(:any, /.*/ ).to_timeout
Add Comment
Please, Sign In to add comment