[Catalyst] semi-OT: is it possible to circumvent tests that are related to WWW::Mechanize?

Matt Lawrence matt.lawrence at ymogen.net
Fri Nov 2 14:01:17 GMT 2007

Joe Landman wrote:
> Hi folks:
>   Working on deploying a Catalyst app on a customers machine.
> Installation is going well ... until the Catalyst modules that depend
> upon WWW::Mechanize and family come up.
>   As far as we can tell, the breakage is not the modules, but the
> WWW::Mechanize (and therefore, by extension, things that use
> WWW::Mechanize).
>   Is it possible to simply disable the use of this module during
> installation and testing?  This is on an internal customer-site
> machine, with no easy access to the rest of the net, and
> WWW::Mechanize really wants access to the rest of the net (with a
> whole lotta hardcoded tests to wikipedia and other such things).
>   I could "force" it, but so many things seem to depend upon it for
> testing ...
>   Advice, clues, pointers are welcome.
Depending on the exact nature of the tests, it might be possible to use
Test::MockObject or similar to make the tests pass.

Otherwise, if the relevant tests will skip when WWW::Mechanize can't be
found (or can be made to), you can use Module::Mask or Devel::Hide to
fool the system into thinking it's not there.

HARNESS_PERL_SWITCHES=-MModule::Mask=WWW::Mechanize make test

I should probably point out that I'm the Module::Mask author, just in
the interests of full disclosure ;-)


More information about the Catalyst mailing list