Open joshua-morris opened 5 years ago
Can't a compiler pragma be used to set baseURL = sandboxURL
when compiled with a debug flag for example?
For example it could be something like: change in proj.cabal:
...
--cpp-options: -DSANDBOX
...
and in the Stocks.hs
we do:
#ifdef SANDBOX
baseURL = sandboxURL
#endif
There's probably more than 1 way to fix #1. What do you have in mind how to approach it?
Cheers, Vlad
I tried to do what you describe here, but I didn't succeed and have no more time this weekend. Basically when i run "stack test" with default=True on the flag, the system still does not call the sandbox URL.
https://github.com/ksallberg/iexcloud/commit/688eed3ae3fb5d22918b12a28c0ca7c7b2f4814a
If you want you could help me out if you see what is wrong. Also I think this change would conflict with the relaxation of dependencies that you proposed.
Another approach could be to require the user to specify the URL they want to use in each API call. But that would put more burden on the user of this code.
Adapt the tests to use the sandbox API key.