-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
“Client not configured” error #13
Comments
IMHO it is related to rspec mocking (instance_doble). Because when I've tried to swap instance doubles with real object instances it works. Maybe it is linked to mauricio/rspec-mocks@80c740e |
Yep, it occured to me that it might be some metaprogramming mindfuck caused by the fact that KOSapiClient module acts both as a namespace and a delegator for a client. |
In this exact situation, that is not caused by metaprogramming. The problem here is that the mocking service is invoking I've come around with a solution, which is less "hackier" in 9cb112f of #10 |
Well, look at the date of that PR, this behaviour has been fixed in RSpec 3.0. Since we don't have a Gemfile.lock file, I guess this is some regression in newer RSpec (I run this on 3.2). So the solutions are:
|
In 0439b5b I have refactored client lazy initalization to be more robust. Before this change an error was thrown right away when the client was initialized without supplying API credentials. Now the client only throws an error when an API request is made without credentials. It should fix this issue in a clean way and it also prevents other possible problems in the future. |
👍 Nice job, this is definitely an improvement though I'm still not a fan of the top-level stateful singleton |
Somehow some specs are failing on top-level class which should delegate calls to a client instance: https://travis-ci.org/cvut/kosapi_client.rb/jobs/53568760
This is happening even with isolated classes like HttpClient – something is trying to call
to_str
onKOSapiClient
. Frankly, I have no idea what's going on.The text was updated successfully, but these errors were encountered: