Forum: Typo defined $TESTING

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Matijs van Zuijlen (Guest)
on 2007-06-09 11:19
(Received via mailing list)
Hi,

The copy of memcache.rb in typo's trunk has the line

  $TESTING = defined? $TESTING

at the top. This means that after including memcache, $TESTING is
definitely defined. If we're testing, it's true, if not, it's defined
and
false.

In the typo code elsewhere, the checks for testing mode only check
whether
$TESTING is defined, not what its actual value is.

This means typo always runs in testing mode!

I believe this is the main reason threaded trackback pings were not
working properly.
Piers C. (Guest)
on 2007-06-09 11:28
(Received via mailing list)
On 09/06/07, Matijs van Zuijlen <removed_email_address@domain.invalid> wrote:
> In the typo code elsewhere, the checks for testing mode only check whether
> $TESTING is defined, not what its actual value is.
>
> This means typo always runs in testing mode!
>
> I believe this is the main reason threaded trackback pings were not
> working properly.

Oh dear ghod! Thanks for the spot. I shall fix it immediately.
Chris P. (Guest)
on 2007-06-12 18:29
(Received via mailing list)
On 6/9/07, Piers C. <removed_email_address@domain.invalid> wrote:
> >
> > In the typo code elsewhere, the checks for testing mode only check whether
> > $TESTING is defined, not what its actual value is.
> >
> > This means typo always runs in testing mode!
> >
> > I believe this is the main reason threaded trackback pings were not
> > working properly.
>
> Oh dear ghod! Thanks for the spot. I shall fix it immediately.

Thanks indeed.  For those of us running the gem, just comment out or
delete the $TESTING = defined? $TESTING line and watch your Typo
instance go Vroom :)

-Chris

--
 Chris P. --- Y!: feoh -- AIM: chrisfeohpatti --- E-Mail:
removed_email_address@domain.invalid
"The greatest dangers to liberty lurk in insidious encroachment by men
of
  zeal,well-meaning but without understanding."-- Justice Louis O.
Brandeis
 (Olmstead vs. United States)
This topic is locked and can not be replied to.