davidchambers/doctest — pull request #1 by danse (2012-12-02 14:36:14+00:00)
Title: Now run it from the command line!

Hi, I like your project, I think it is better that the one of Ian Bicking, which does not looks like actual doctests for me.

I used widely doctests in python, and they were awesome to design objects which interacted through native data types. I felt the need to be able to doctest javascript files more quickly and easily, though, and so I wondered if it was possible to add few functionalities to your project in order to use it from the command line and directly on a javascript file.

And here it is! Still some tests are not working, and the overall design could be improved, I think, but now that I ended up with a good proof of concept, I must refer to you for design decisions, and for you suggestions since you deeper understand the meaning of the tests. Some tests are failing both in the command line and in the served run, but the most of them is working.

Some notes about the pull request:
- I had to extract some logic from `fetch` into `generate_fetch_callback`, but the name of this new function is just temporary ... please choose a better one you like
- I had some problems with underscore js, and my quick and dirty solution is quite ugly. Maybe it would be possible to not use it, in order to have a cleaner code? For example, using javascript builtin forEach array method
- I added few notes at the end of the README, they are just in order to not forget to improve that part of the doc
- I added a package.json, but still it is widely incomplete, also that was just to start using one

Okay, I hope you like this, please report me your thoughts about the development of your project, I really find it a smart and actual doctest implementation and I did not find any others around.

Thanks!