1

Is there any tool usually used in Common LISP tests to block all network requests and stub responses for specific URLs?

Just for reference, in Ruby we usually use:

(or even more powerful tools like https://github.com/vcr/vcr made on top of them)

I know similar tools exist in Python (I remember this one: https://github.com/gabrielfalcao/HTTPretty) and I have found:

https://github.com/johanhaleby/stub-http

created for Clojure and described here:

Strategy for stubbing HTTP requests in Clojure tests

Is there anything similar to this? If not, what do you usually test code that open connections and do external requests. Do you only mock methods directly with tools like mockingbird and cl-mock or is there anything I'm missing?

  • 1
    There is [vcr](https://github.com/tsikov/vcr) similar to this. I *think* I used it once, but nowadays I use a mocking library (to mock the function that does the network access). – Ehvince Aug 30 '22 at 07:00
  • Thanks for this reference. I tested this package, and it works in some situations, but unfortunately, it didn't work for mocking requests made by cl-s3, which I intended to test in the first place. – Everton J. Carpes Aug 31 '22 at 00:40
  • 1
    I use https://github.com/Ferada/cl-mock for this. Some mocking frameworks/libs can't capture invocations that don't originate from the same thread as the mock setup (like Mockingbird). cl-mock can do that. – Manfred Sep 03 '22 at 13:54

0 Answers0