Fix errors in tests on Windows

Some tests are still failing, though. This commit fixes wrong usage of
temporary paths on Windows. Please, note: the `edit` command is working
well; the issue is in poor tests.

Prettify some ugly code in `spec/editor_spec.rb`.