[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

anti-require?

Giles Bowkett

12/6/2006 1:36:00 AM

Is there something like "unrequire"? test/unit is being loaded by a
slightly spaghetti Rails app and I want to eliminate that. It's giving
me a "0 test, 0 assertions" footer on every page load in dev and
driving me nuts. The problem doesn't exist in production, just
somewhere in dev, and I don't have time to fix it right away.

--
Giles Bowkett
http://www.gilesg...
http://gilesbowkett.bl...
http://gilesgoatboy.bl...

3 Answers

Christopher Schneider

12/6/2006 2:01:00 AM

0

Grep? figure out where it's being loaded and remove it.

-Chris

On Dec 5, 2006, at 6:36 PM, Giles Bowkett wrote:

> Is there something like "unrequire"? test/unit is being loaded by a
> slightly spaghetti Rails app and I want to eliminate that. It's giving
> me a "0 test, 0 assertions" footer on every page load in dev and
> driving me nuts. The problem doesn't exist in production, just
> somewhere in dev, and I don't have time to fix it right away.
>
> --
> Giles Bowkett
> http://www.gilesg...
> http://gilesbowkett.bl...
> http://gilesgoatboy.bl...


Eric Hodel

12/6/2006 2:08:00 AM

0

On Dec 5, 2006, at 17:36 , Giles Bowkett wrote:

> Is there something like "unrequire"? test/unit is being loaded by a
> slightly spaghetti Rails app and I want to eliminate that. It's giving
> me a "0 test, 0 assertions" footer on every page load in dev and
> driving me nuts. The problem doesn't exist in production, just
> somewhere in dev, and I don't have time to fix it right away.

There's a few places in Rails where they mean to require 'test/unit/
assertions' (or some other file) but instead require 'test/unit'.
Switch the offending lines and you should be good.

--
Eric Hodel - drbrain@segment7.net - http://blog.se...

I LIT YOUR GEM ON FIRE!


Ross Bamford

12/6/2006 2:33:00 AM

0

On Wed, 06 Dec 2006 01:36:09 -0000, Giles Bowkett <gilesb@gmail.com> wrote:

> Is there something like "unrequire"? test/unit is being loaded by a
> slightly spaghetti Rails app and I want to eliminate that. It's giving
> me a "0 test, 0 assertions" footer on every page load in dev and
> driving me nuts. The problem doesn't exist in production, just
> somewhere in dev, and I don't have time to fix it right away.
>

A quick hack that might work, until you get chance to fix it properly. Do
this somewhere early on:

$" << 'test/unit.rb'


--
Ross Bamford - rosco@roscopeco.remove.co.uk