The subtle issue here is that __method__ was referencing the statically defined method name (in this case, always result), whereas __callee__ references the dynamically called method name (in this case, random_result).
Usually, __callee__ is the same as __method__. But in some situations - such as here, where I've used alias - it's different.
The upshot of this is that previous versions of the gem may have had a limited results set to choose a "random example" from; in particular if the regex contained a "MultiGroup" (anything with brackets), and the number of possible results within those brackets was over 10,000 (the default max_results_limit).
Coverage remained the same at 100.0% when pulling 8140e2c0d48bfbe4a6388690e7bf4b1ca515b0c3 on fix_random_example_dataset_regression into 42e1afcc238dbf5bdbd86fc4358cef335409816b on master.
Fixes https://github.com/tom-lord/regexp-examples/issues/21
The subtle issue here is that
__method__
was referencing the statically defined method name (in this case, alwaysresult
), whereas__callee__
references the dynamically called method name (in this case,random_result
).Usually,
__callee__
is the same as__method__
. But in some situations - such as here, where I've usedalias
- it's different.The upshot of this is that previous versions of the gem may have had a limited results set to choose a "random example" from; in particular if the regex contained a "MultiGroup" (anything with brackets), and the number of possible results within those brackets was over 10,000 (the default
max_results_limit
).