You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One may think that the above elsif is equivalent to ... else value end or ... elsif value; value end, but neither is the case. As seen in this gist, it's a strange, empty elsif block with nil as a return value. The method is functionally equivalent to the following:
Additionally, if we change that nil to ">FOO!" the test suite continues to pass. So while this is a private method, we should probably fix this and ensure it is tested.
What is the desired outcome of this case? value, value.to_s, or KABOOM! with a raised exception?
The text was updated successfully, but these errors were encountered:
The following conditional found in lib/punchblock/component/output.rb has a misleading final
elsif
:One may think that the above elsif is equivalent to
... else value end
or... elsif value; value end
, but neither is the case. As seen in this gist, it's a strange, empty elsif block with nil as a return value. The method is functionally equivalent to the following:Additionally, if we change that
nil
to">FOO!"
the test suite continues to pass. So while this is a private method, we should probably fix this and ensure it is tested.What is the desired outcome of this case?
value
,value.to_s
, or KABOOM! with a raised exception?The text was updated successfully, but these errors were encountered: