[Radiant] Virtual Domain extension for mental

Brian Gernhardt benji at silverinsanity.com
Fri Dec 15 11:47:19 CST 2006


On Dec 15, 2006, at 10:47 AM, Adam Williams wrote:

> It's interesting to me that in VirtualDomainPageTest#setup, a Page
> instance is created, it's class_name set to VirtualDomainPage, and
> then it is reloaded as a VirtualDomainPage instance. Immediately
> afterward, @page.children.create is invoked, which doesn't blow up.

The back and forth was the easiest way I could find to get the  
correct class for the Page without writing new fixtures myself.  And  
it was the closest analogue to the way the original set the behavior  
before beginning the tests.

I tried playing around with that @page.children.create, which didn't  
change anything (much to my surprise).  It was only when I tried to  
access @page.children.* in the tests that it bombed.

I might just try to re-write the tests completely.  Currently I'm  
just trying to make the smallest changes needed to get the 0.5  
behavior to work properly as a mental page type.  I don't want to  
make any large changes as it's not originally mine...  And now that I  
look at it, there's no licensing information in the original code.   
Hmmm...

> Looking closer, I found that the 'Anonymous module' that has 'no name
> to be referenced by' is NoCachePage, defined in the PageTestHelper.
> The stack and ruby-debug output is below. I confess that I don't know
> enough at the moment about all the interactions of your tests with
> the PageTestHelper, but this might help someone else, or you, figure
> out wazzup.

[cut debug output]

Ah!  A ruby debugger!  How the heck could I have forgotten it  
existed!  Bad me!  Especially after the hours I've spent with gdb...

The PageTestHelper must be mucking with something before the tests to  
add the NoCachePage.  I'll have to see what's going on, and it'll be  
much faster with a debugger at my fingertips.

~~ Brian



More information about the Radiant mailing list