Open alexcwatt opened 1 year ago
@piotrmurach The errors now focus on "numeric" instead of a particular class. Let me know what you think!
@piotrmurach I've made that small change for consistency
@piotrmurach let me know if you want me to do anything else to make this mergeable
@alexcwatt This is on my list, I promise I'm not ignoring you. Please bear with me.
Describe the change
I noticed that
#current=
failed for indeterminate progress bars. The primary test I added would error like this:I added a new
ArgumentError
guard to also preserve the existing, desirable, behavior of not supporting#current = nil
, and a test to cover this. Note thatcurrent = nil
was already raisingArgumentError
in both the determinate and indeterminate cases (comparison of Integer with nil failed
,comparison of NilClass with 0 failed
, etc.); now the error message is one that we set.Why are we doing this?
As far as I can tell, there's no reason that
current =
shouldn't work for indeterminate progress bars. It seems that indeterminate progress bars are meant to have acurrent
value, and can have it by calling.advance
, so adding support seems consistent with the rest of the library.Benefits
It's quite nice to be able to set current progress for indeterminate progress bars!
Drawbacks
I don't have any to highlight.
Requirements
master
branch?