Closed Eckankar closed 8 years ago
Could you please include a test? I know I haven't quite gotten the test coverage I would like but I that doesn't mean I don't have ambitions :-P . If you want to go the mocking route I'd prefer Mock::MonkeyPatch.
:+1:
I've added a test that verifies that the --cookies-file
argument is received correctly by PhantomJS.
I have moved this back to a branch (sorry for the force push people). The new test hangs for me and until I figure out why this shouldn't have been merged.
I have no idea why the original branch hung. Today I set about to cleanup the mess I made of #3 which happened because I deleted my local branch (since I forgot that that PR was my replacement of this one) and by doing so closed it. After @plicease removed the errant tarball that was in these commits and I rebased it against current master it passed. Therefore I have now merged and released it. Sorry it took so long :D
This pull-request introduces the argument
arguments
forMojo::Phantom::Process
andMojo::Phantom
, andphantom_args
forTest::Mojo::Role::Phantom
.Their role is to pass command-line arguments directly to the PhantomJS process.
The motivation behind the pull-request is as follows:
We've found our PhantomJS tests to sometimes start failing an awful lot. After much debugging, we found out that deleting the contents of the PhantomJS local storage directory solves these problems, so we reckon it sometimes manages to get corrupted, messing up any future tests until it has been reset.
By calling PhantomJS with
--local-storage-path
, we can specify a clean directory to be used for each test, and avoid this problem cleanly.