fix test runner, https://gist.github.com/tmatsuo/10325740

fix test runner ,code by @tmatsuo https://gist.github.com/tmatsuo/10325740