Gavin Sinclair wrote:

>>Why don't just use "breakpoint unless x + y == 10" then? I think it 
>>makes sense to use something more concise here.
> 
> That option is still available.  breakpoint_unless 'x + y == 10' has
> the added benefit that the breakpoint can be identified by the
> condition that triggered it.  E.g. you run the program and see on the
> console:
> 
>   Breakpoint because 'x + y == 10' is false.
>   irb>
> 
> Is that a convincing benefit?

This does indeed sound nice.

>>I don't know -- the syntax just seemed so very unnatural. Like something
>>you wouldn't meet anywhere in the standard library...
> Debugging code often stands out in this unfortunate way, though.  It's
> lower level than normal code.

But note that this is something that can even remain in production code.

> Now let me ask you: since you proposed
> 
>   assume { x + y == 10 }
> 
> what does that provide over
> 
>   breakpoint unless x + y == 10
> 
> ?

I think it looks nicer and it can be ignored if the code is not run in 
debug mode.

What would you think about an assume() method that could take either a 
block or a String?