Fix error in tests on Windows

Stubbed paths must account for platform differences in separator
characters.

Resolves gh-1931
Use `path.join` properly and in more places.