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
Trying to test with collection_tests but getting error #158
Comments
@jsirex could you share a link to where the test files are? I think that might help me narrow in on the issue. Thanks! |
Here is collection_tests helper: https://github.com/fog/fog-core/blob/master/lib/fog/test_helpers/collection_helper.rb#L33-L49 You're testing Enumerable with list of methods. First of them is Here you're trying to pass block to method I've work-a-rounded this method by updating all my collections to accept block: ...
Class MyCollection < Fog::Collection
# This one doesn't work
def all
data = service.get_data(...)
...
end
# Does work
def all
data = service.get_data(...)
...
yield if block_given?
end
end |
Hmm. I'm not sure. We have examples in other places that seem to NOT yield, but still pass, ie:
I'm not seeing what the difference is there off hand though. |
First time I've wrote exactly as in your example. But it doesn't work for me. Used ruby 2.1.5. Actually, I'm not a "ruby profi" and can't understand why addresses_tests in your example works for you. |
You know, as I dig deeper here, I think there is a typo. Namely, I think that is supposed to be Will push a fix in a moment, sorry for the confusion. |
collection.all
testing twice.How it designed? Should I implement possibility to pass block to method "all" or this is really bug?
The text was updated successfully, but these errors were encountered: