Specs for where $_ is defined and when it is defined?

Because what we are testing here is that if you have used gets, and so $_ has been set in some method, that it isn't defined in other methods. Your code doesn't test for that, because it isn't using gets to set the variable in another method. It checks that it's initially nil, but not initially nil after gets has been called in another method.

I'm not sure how to debate with you whether or not something is a bug. Aren't we writing specs for MRI behaviour? Can we declare something to be a bug? Should we open an MRI bug for it first? They may decide it's intended behaviour.