Ran
|
Files
26
|
Run time
2s
|
Badge
Embed ▾
README BADGES
|
push
github
Add support for optional `count` arg in `rpop` (#308) `rpop` accepts an optional `count` argument to indicate how many elements should be removed and returned from the list See https://github.com/redis/redis-rb/blob/9938411bd/lib/redis/commands/lists.rb#L114 Also had to change the shared examples a little bit to be able to pass the arguments they use and make a more accurate expectation on the error. I think the `args_for_method` is making an assumption when the `arity < 0` and always using `[1, 2]` (+ the key), but that doesn't work in all cases. In particular, `rpop` now has `arity` `-2` (because it has 1 required arg + 1 optional) so calling `rpop(key, 1, 2)` was causing an argument error instead of `Redis::CommandError` (which we expect because of the redis value not being a list). At first I tried to change `args_for_method` but it made other tests fail. And i suspect it won't be possible to have a generic args generator only based on arity (because some methods for example accept `*args` but the logic requires 1 or 2 args) That's why i thought it might be a good idea for each test that includes the shared example to indicate what the correct args to make a valid call should be, but let me know what you think!
1805 of 1841 relevant lines covered (98.04%)
399.26 hits per line
Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
---|