Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

jk2addict (4946)

jk2addict
  (email not shown publicly)
http://today.icantfocus.com/blog/
AOL IM: chrislaco (Add Buddy, Send Message)
Yahoo! ID: chrislaco@sbcglobal.net (Add User, Send Message)
Jabber: laco@scribblewerks.com

Journal of jk2addict (4946)

Wednesday May 16, 2007
10:05 AM

In Rant Mode: Part I

[ #33291 ]

I just feel the need to release some good old frustration. Move along. There's no real content here. :-)

Last night, I wasted a half hour of my life trying to figure out why this simple thing dies:

use_ok('Catalyst::View::TT');

After stripping away various modules and code, it all came down to this:

C:\Mango>perl -MTemplate::Timer -e 1
<NO OUTPUT>
C:\Mango>perl -MTest::MockObject -MTemplate::Timer -e 1
Died at C:/strawberry-perl/perl/site/lib/Template/Timer.pm line 63.
Compilation failed in require.
BEGIN failed--compilation aborted.

That's bullshit. Plain and simple. I knew the dangers of Test::MockObject, but this is the first time it has bitten me in the ass. Grumble Grumble.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Aside from the one RT that directly is about this problem, I'd say at least 2 other RT reports are because of the aggravation-at-a-distance caused by MockObject, or probably really the forced loading of UNIVERSAL::can...

    http://rt.cpan.org/Public/Dist/Display.html?Name=Template-Timer [cpan.org]
  • I knew the dangers of Test::MockObject...

    That it warns about buggy code and refuses to attempt to do the wrong thing? That's not an accidental feature....

    • That it loads modules that causes other modules to fail...without notice or reason...

      Warning about what you/I/we/they think is bad practice is one thing...causing outright failures is something totally different.

      Again, I'm not using UNIVERSAL::can... I'm using Test::MockObject. The act of loading and using T::MO should not cause other shit to completely die and blow up.
      • T::MO takes it in the shorts, no matter what I do.

        If I do nothing with regard to the methods can() and isa(), buggy code assumes that calling those methods as functions gives correct answers, and breaks the test code.

        If I try to work around that damage so that the results are somewhat correct, people complain that they've learned that their buggy code has bugs in it and blame T::MO.

        I'm starting to think that people don't want to find bugs through testing.

        • Well, that's sort of true really. I'd wager people just don't want to find other peoples bugs in testing. :-)
  • Problem: some test module breaks a lot of working code. Solution: don't use that module.