From: Bret Pettichord Date: 2005-09-30T05:32:17+09:00 Subject: Re: Gems undermine unit testing At 06:13 AM 9/28/2005, Jim Weirich wrote: >Then I am mystified. *Something* is causing the gem to be loaded. The fact >that the tests run correctly without the gem installed indicate the it is not >activated by need (since obviously you don't need it), nor by require_gem. I was using breakpoint to try and debug this situation, but i now think that it may have had side effects itself that confused me more. I did require 'breakpoint'; breakpoint In my script, and then from irb, checked $LOAD_PATH. That was when i saw that the directory to the watir gem library preceeded the 'current directory' that i had prepended to it. I'm now wondering whether i in fact was getting the right watir library through require because the load path didn't get changed until later. But if this is true, then if i had required a gem library before the watir require, i would not have loaded the one i wanted. It seems that the gem mechanism changes the load path to speed up further requires. But i am wondering if it modifies it more drastically than it needs to. If i am require'ing 'breakpoint', the paths to other gem libraries should not be showing up on the load path. This is all somewhat speculative, because while i was trying to track this down, i started getting a different version of breakpoint than i intended. There apparently is a 'breakpoint' library in one of the rails gems and it was being loaded instead and it was redefining the module class in a way that made the modules in my code break. I ended up uninstalling a dozen gems that i had installed last week because i knew i was running into interaction problems and i needed to simplify my situation. Bret _____________________ Bret Pettichord www.pettichord.com