Windows - Setting Time.now
While reviewing a MinGW build
test-all failure in TestLogDevice#test_shifting_midnight_exist_file, I determined the cause. The test in question (and other tests that seem to have newer/better exception handling) sets
The thread StackOverflow - Change system date programmatically seems to imply that in some instances/configurations, changing the system time on Windows systems requires elevated permissions.
I tested on both a mswin build (
ruby 2.5.0dev (2017-05-27 trunk 58922) [x64-mswin64_140]) and a MinGW build (
ruby 2.5.0dev (2017-06-08 trunk 59046) [x64-mingw32]), and both responded to:
Time.now = Time.mktime(2017, 1, 3, 1, 1, 1)
with the following eror:
undefined method `now=' for Time:Class (NoMethodError)
Both also had
false = Time.respond_to?(:now=).
So, I'm confused as to how this test passes on mswin. Regardless, the test requires a skip to bypass it and allow MinGW test-all to pass.
I thought I'd file an issue before doing a PR. I'm building and testing on Win7. Finally, if anyone has time, where is the method