holmes-app / holmes-api

API for holmes website validation.
MIT License
17 stars 7 forks source link

Work with local Phantomas and use check_output instead of Popen #28

Closed scorphus closed 10 years ago

scorphus commented 10 years ago

As defined in "setup" in the Makefile (http://github.com/heynemann/holmes-api/blob/40bf091/Makefile#L18), Phantomas is installed as a local Node.js module. `npm bin´ outputs the "bin" directory path (it's not really necessary but safer.)

As it is necessary to wait until the Popen call finishes, use check_update instead which already returns the command output as string. This makes the code simpler.

While testing, check_output_mock needs to return two different values depending on the arguments. A side_effect function was defined (check_output_mock_side_effect) to do just that.

Some variables were renamed to a more significant name.

Comments and/or suggestions are welcome.