On 8/21/07, [email protected] [email protected] wrote:
that can flag these at compile time?
I used unit tests and rcov for that - write simple tests that run at
once through the code to catch these typos. Then run them with rcov
(gem install rcov) to see the coverage - what code has been tested and
what not. Finally either write more tests for the uncovered parts or
at them more carefully
The thoroughness of this depends on the tests you write - it’s possible
in one scenario you get object that has one particular method, and
time you get different object that hasn’t. Your goal is to cover as
much of these
cases as possible.
You don’t have to call your long-running stuff (=design tools?) in the
you should avoid them as much as possible, using so called mock objects
simulate the behavior of the expensive methods/objects. The goal is to
that will quickly check your code for errors. For more info see
or general test-driven development (TDD) docs.
Other than that, there’s no compile time, there’s “parse time”
Try turning -w on (i.e. ruby -w ) to see more warnings.
Maybe something from ParseTree gem and friends might be useful as well,
I don’t think there’s a tool to do this particular thing (check for