Verify code is runnable

Hi,
    Before I start I realize the optimal solution is to have 100% code
coverage with tests, unfortunately we are not there yet.

Yesterday I cam across a bug in our code base where the number of method
parameters had changed but not all references to the method had been
updated. My IDE Rubymine highlights this as an error.

Is there a way to check my code base in something like the format of an
rspec test that would highlight such bugs entering the system?

Thanks a Million,
Anthony

···

--
Posted via http://www.ruby-forum.com/.

I think Laser (https://github.com/michaeledgar/laser/\) should be able to do
this, but when I tried I got a stacktrace. It might work for you. If not,
let the dev know how much you'd appreciate it :slight_smile:

As an alternative, you can do what's called a "smoke test", which is a high
level test that just runs the code and makes sure it doesn't raise any
errors. You're not really unit testing anything, but you are executing the
code, and so an error like this should reveal itself. For example, on my
website I use Capybara to go to every page (it uses a headless browser). I
actually check a number of things on these pages, but if there was a problem
like mismatched arity, the page would raise an error, and my tests would
find it.

···

On Tue, Sep 27, 2011 at 3:55 AM, Anthony B. <atbrew@gmail.com> wrote:

Hi,
   Before I start I realize the optimal solution is to have 100% code
coverage with tests, unfortunately we are not there yet.

Yesterday I cam across a bug in our code base where the number of method
parameters had changed but not all references to the method had been
updated. My IDE Rubymine highlights this as an error.

Is there a way to check my code base in something like the format of an
rspec test that would highlight such bugs entering the system?

Thanks a Million,
Anthony

--
Posted via http://www.ruby-forum.com/\.

Its a bit old (and I have not used it, so don;t no if it will work for you
but DRuby (http://www.cs.umd.edu/projects/PL/druby/index.html) does
static analysis and includes checks for wrong number of arguments
(http://www.cs.umd.edu/projects/PL/druby/manual/manual.html#x1-230006.1.2)

cheers