Hi team,
I'm investigating various RubySpec failures on Windows, against both
MRI and JRuby, and here's one of the issues:
Essentially, ARGF.binmode is a one-way ticket, once it is set, it
cannot be unset, right? But with global constant like ARGF that
essentially makes the method totally untestable, since the very first
call to ARGF.binmode sets the bin mode, and any subsequent tests can't
get to the original state. Not to mention that the ARGF will be in
this nondefault mode for the rest of the test run, which is not good
as well.
Ideally, for any (nondestructive) action there should be some way to
get back to original state. Any suggestions for ARGF.binmode? Or, it
seems, the specs would need just to be removed, which doesn't feel
good.
Well, I could execute the tests externally, invoking yet another ruby
instance and checking the output, but it would be soo much easier to
have ARGF.binmode= ... :)
Thanks,
--Vladimir