Testing is the canary in the coal mine. If testing is hard, refactor the code.

Practical Object-Oriented Design in Ruby

This is a type of code smell. If you are trying to test a part or all of your program and you are having a lot of trouble it should be a warning sign that the code is either not well structured or you need to consider refactoring the portion that is giving you trouble.