Очевидный способ, чтобы сделать это должен был бы переопределить все операторы (+ и * в особенности) и проверка на переполнение прежде perorming операции.
controller.instance_variable_get(:var)
if you find yourself doing this, you might want to rethink your approach to information hiding so that you are testing essential behavior rather than incidental implementation details. Your tests should ensure that the "thing" functions as it should without being too tightly bound to the particular implementation.
EDIT: Isn't assigns(:var)
the rails testing magic for doing the same thing with controllers?