Showing posts with label testing. Show all posts
Showing posts with label testing. Show all posts

Monday, July 5, 2010

rails testing - undefined method `request='

Problem:
test_some_functional_test_case(SomeFunctionalControllerTest):
NoMethodError: undefined method `request=' for #<SomeMispeltFunctionalController:0x7f5b55bd0a58>

Solution:
Basically it means you haven't required the controllers file. Or you have a typo in the name that is instantiating the a non controller for the @controller variable in the test.

Saturday, May 29, 2010

Testing sorts

Basically in my last 2 posts I have been using a macro called SCAMBLE to test my sorts

#define SCRAMBLE(x, y) ((0xa57b & ~y) + ((0x3829 & x) << 1))

The average sort algorithm starts to have issues when there is repetition in the data. This SCAMBLE macro is a broken Psedo-Random number generator core. In short since its broken it gets stuck into a loop of numbers which makes it useless as a random number generator but is exactly the input I want to test the sorts.