Add test count_values_non_tally

This commit is contained in:
kojix2
2021-01-19 22:37:15 +09:00
parent fbfcf80d25
commit 10e096d7c9
2 changed files with 8 additions and 2 deletions

View File

@@ -6,9 +6,9 @@ module YouPlot
module Processing
module_function
def count_values(arr)
def count_values(arr, tally: true)
# tally was added in Ruby 2.7
if Enumerable.method_defined? :tally
if tally && Enumerable.method_defined?(:tally)
arr.tally
else
# https://github.com/marcandre/backports