Ad
  • Custom User Avatar

    This kata reeks of a lack of understanding of Ruby blocks. It is not about blocks, it's about Procs: lambdas are also blocks that can be passed in and used the same way, but break and return behaves exactly like next in a lambda, and hence indistinguishable from :ok case.

    (Also, what's the point of testing block constructs outside the lexical scope it is defined at? return and break only makes sense inside the same closure. Explicitly detecting them seems like a newbie's toy experiment coming from not actually reading the language specs.)