| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
Thanks for opening this PR! This is a nice quality-of-life improvement. I have just a couple of comments about the test coverage (which I have been trying to improve with every PR).
Sorry, something went wrong.
| def test_each_enum | ||
| called = 0 | ||
| @result.reset(1, 2) | ||
| @result.each.to_a.each { |row| called += 1 } | ||
| assert_equal 2, called | ||
| end |
There was a problem hiding this comment.
I would like this test to also assert that the .each returns an Enumerator object. I'd also like a similar test for .each_hash, something like:
def test_each_enum
@result.reset(1, 2)
enum = @result.each
assert_instance_of Enumerator, enum
assert_equal 2, enum.to_a.length
end
def test_each_hash_enum
@result.reset(1, 2)
enum = @result.each_hash
assert_instance_of Enumerator, enum
assert_equal 2, enum.to_a.length
end
Sorry, something went wrong.
There was a problem hiding this comment.
yeah those are fine, just copied over. I also noticed we should return self when no block, so also added tests for that.
Sorry, something went wrong.
| @@ -46,6 +46,7 @@ def next | |||
| # Required by the Enumerable mixin. Provides an internal iterator over the | |||
| # rows of the result set. | |||
There was a problem hiding this comment.
Please also update the docstring!
Sorry, something went wrong.
There was a problem hiding this comment.
changed. lmk if good.
Sorry, something went wrong.
| @@ -54,6 +55,7 @@ def each | |||
| # Provides an internal iterator over the rows of the result set where | |||
| # each row is yielded as a hash. | |||
There was a problem hiding this comment.
Please also update the docstring!
Sorry, something went wrong.
There was a problem hiding this comment.
changed. lmk if good.
Sorry, something went wrong.
|
Sorry for the delay here, I've got a large open-source backlog at the moment and plan to get back to this shortly. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Returns an enumerator. Matching similar methods in ruby stdlib.