dthree/cash

unit tests modify my cashrc file

nfischer opened this issue · 4 comments

The unit tests unfortunately wipe out my ~/.cashrc file and don't replace it. This isn't the most user-friendly behavior, since I'd actually like to be able to write up configurations in there eventually as cash evolves. And I'm not the biggest fan of having a file named fizzlecrumbs on my file system...

Any chance we could either get rid of this test or find a way to reliable replace the file after tests are done (and provide a warning if the file isn't restored)?

Haha shoot. Let's just skip it for now and then I'll do some fancy cleanup.

Ok. I have some code that swaps it out more reliably. Looks like the test was already being skipped. I think it needs an interactive vorpal session to start before it will load the .cashrc file.

I was skipping because it loads as soon as you require index.js, and requires are cached between files. So if test/index.js wasn't the first text file, it's going to read .cashrc before I wrote in it, thus not writing the file, thus breaking the test. Kind of annoying.

Ah, I see the issue now. Yeah, not sure if there's a good fix for that then. I left the test mostly as-is (I modified the test() function a bit).