Running the actionpack test suite for r7076 produces:
./test/controller/new_render_test.rb:3: superclass mismatch for class Customer (TypeError)
This is because Customer is already defined as being a different type of struct at the top of test/controller/render_test.rb. My guess is that nobody's seen this before due to load order issues, since the "definition" in render_test.rb is guarded against multiple definitions, while the one in new_render_test.rb isn't. If new_render_test.rb loads first, then everything's OK since the more extensive form of Customer gets loaded and the guard prevents multiple definition. However, render_test.rb gets loaded first for me, and so everything goes to poop.
The attached patch handles this problem in two ways:
- It guards both instances of Customer against multiple definition (this prevents any possibility of "superclass mismatch" errors);
- The definition of Customer has been corrected to be the same in both cases (since otherwise, if the (:name) form of Customer is used, other tests fail).
The real solution, IMHO, is to split the definition of Customer out into a separate file and require it wherever it's needed, but I don't know where such a file would go, so I'm leaving that well alone and sticking with the "slightly hackish" version.