RubyFlow The Ruby and Rails community linklog

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)     ... Calling Foo.new.foo(42) will write This 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

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in