Hi,
this looks very nice so far! I have one recommendation here. Instead of storing TestNumber in the test, just store the expected history result and directly compare it here. Then you don't need the long if ... elsif ...
Regards, mg