Preconditions and Postrelations on your methods with Gendarme
I have just released a beta version of Gendarme. It began as an experiment for annotating methods (i.e: add metadata to them), so I went thru a complete exercise and built Gendarme. [more inside]
Comments
This is wrong on so many levels I don’t have enough space to begin!
Bit long for the front page so I’m pasting the source part here..
class Foo include Gendarme::Gendarme precondition(0,"Arg 0 (bar) is a String") { |bar| bar.respond_to?(:to_str) } def foo(bar) ...
CallingFoo.new.foo(42)
will writeThis precondition is false: Arg 0 (bar) is a String
to the logger.This does not replace a test suite, the usage is completely different (plus it’s an experiment).
Post a comment