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
{{ message }}
This repository has been archived by the owner on Feb 23, 2022. It is now read-only.
Currently outside of the repo, I have tests that run on the actual API. I would like to stub out these requests, but I'm not really sure how to go about that, especially considering the fact that the Account_API and Withdraw_API rely on credentials.
Any suggestions welcome.
The text was updated successfully, but these errors were encountered:
Unfortunately I lost my personal tests when I switched from developing on Windows to WSL. Stupid mistake. Anyway, feel free to start from scratch, or I can write up some basic stuff this weekend and we can build on that. I will ask that you use RSpec.
Quick question: Do you plan to mock? I have been eyeing VCR, doesn't really matter to me what you use though. I have implemented passing Faraday adapters to the REST API, so we can also pass Faraday::Adapter::Test::Stubs instances.
VCR is a waste of time as the client does not care about the responses, it returns raw json. It adds nothing if you write tests that expect the response to be what you told the webmock library to return. Then you're just testing the webmock library.
The gem does not try to convert string prices and quantities to floats or anything. You must do everything by yourself. It's just a list of endpoints and which security measures they require and what parameters are supported/required by it.
There's very little magic so also very little to test.
You can just stub the client calls and expect the client to be called with certain params if you want to write specs for the endpoint methods.
There are only a couple of things that should be tested:
the api key header gets sent
the timestamp is added
the requests are correctly signed
The http request internals are already tested in Faraday, no need to re-test.
The websocket internals are already tested in Faye, no need to re-test.
If you add magic and do something with the responses, there's more to test.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
We need tests.
Currently outside of the repo, I have tests that run on the actual API. I would like to stub out these requests, but I'm not really sure how to go about that, especially considering the fact that the Account_API and Withdraw_API rely on credentials.
Any suggestions welcome.
The text was updated successfully, but these errors were encountered: