socketry / cloudflare

An asynchronous Ruby wrapper for the CloudFlare V4 API.
138 stars 86 forks source link

Stub HTTP requests with Webmock #28

Closed lwille closed 6 years ago

lwille commented 6 years ago

I'd like to use this library for production and probably extend it a bit, so I started introducing WebMock in order to get rid of actually calling the CF API (as they don't offer a sandbox).

The code is not particularly well structured, but it's a starting point for safer refactoring and better tests.

ioquatix commented 6 years ago

Good idea.

ioquatix commented 6 years ago

The code is not particularly well structured, but it's a starting point for safer refactoring and better tests.

Yes, it has had a lot of hands in it.

ioquatix commented 6 years ago

If you want to work on it, I will give you access to the repo. Let me know.

I did actually set up a "sandbox" account. But Cloudflare keep disabling it. The credentials are stored on travis, but it only lets me run the tests, because otherwise you could conceivably print out the username/password used (i.e. an untrusted PR).

ioquatix commented 6 years ago

https://github.com/ioquatix/cloudflare/commit/bdf861e38aaf3307a665c4fd9c98de33431f2656 changed the formatting of the entire project. I'm not really okay with that, it needed to be done separately and discussed.

lwille commented 6 years ago

Sorry for abandoning this, but something got in the way. Please consider this a WIP; I will take back the formatting changes because it should indeed be discussed separately.

ioquatix commented 6 years ago

It was generally a good change, but if you are no longer going to maintain the changes, I will revert only the formatting changes as if I am maintaining it, it is my preference. Thanks for your continued effort.