In Rant Mode: Part I

jk2addict on 2007-05-16T15:05:21

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

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.


Aggravation at a Distance

jk2addict on 2007-05-16T16:48:44

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

Hey, That's Projection!

chromatic on 2007-05-16T17:28:07

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....

Re:Hey, That's Projection!

jk2addict on 2007-05-16T18:02:49

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.

Re:Hey, That's Projection!

chromatic on 2007-05-16T21:04:49

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.

Re:Hey, That's Projection!

jk2addict on 2007-05-16T21:52:09

Well, that's sort of true really. I'd wager people just don't want to find other peoples bugs in testing. :-)

But doctor, it hurts when I do this...

educated_foo on 2007-05-17T03:39:12

Problem: some test module breaks a lot of working code. Solution: don't use that module.

Re:But doctor, it hurts when I do this...

chromatic on 2007-05-20T04:37:22

What a strange use of the word "working" to describe code that breaks method overriding.