3 ms·
That was my though too. Are there any languages that let you write specs inline with the functions/classes that they test? That would be cool. Edit: Having tho
by chrisdevereux 14y ago
That was my though too. Are there any languages that let you write specs inline with the functions/classes that they test? That would be cool.
Edit: Having thought about it for a second, this could easily be done in most languages (with some preprocessing to strip out for deployment. Super easy in C-based languages). Not a convention I see anyone follow, though.
- phpnode 14y agoi'm working on a project that does this with doc comments. Basically you add a doc block like this: ### @it should return true expect(foo()).to.be.true ### foo = -> true and the preprocessor extracts the test from the comment and associates it with the foo declaration.