fix rails 3 spec mocking
fix rails 3 spec mocking

if mocha was initialized prior to rails (i.e. if a spec like swagger
that doesn't initialize rails runs prior to a spec that needs rails),
CollectionProxy would remove the mocha methods when it was first defined.
so make sure we restore them

Change-Id: Icf9b1a2598fef279c32b37dd7afe52e15c07c23e
Reviewed-on: https://gerrit.instructure.com/31934
Tested-by: Jenkins <d95b56ce41a2e1ac4cecdd398defd7414407cc08@instructure.com>
Product-Review: Bryan Madsen <0a3ba1af216659500dd8f41e29f3979f42452870@instructure.com>
QA-Review: Bryan Madsen <0a3ba1af216659500dd8f41e29f3979f42452870@instructure.com>
Reviewed-by: Cameron Matheson <1d572acbfa68c7c6e541c7b840d6b622e5c0dc91@instructure.com>

Rvor/canvas-lms,sfu/canvas-lms,va7map/canvas-lms,jay3126/canvas-lms,whalejasmine/canvas-lms,wrdsb/canvas-lms,djbender/canvas-lms,HotChalk/canvas-lms,instructure/canvas-lms,antoniuslin/canvas-lms,ShreniiNepal/shrenii_lmp,narigone/canvas,leftplusrightllc/canvas-lms,tgroshon/canvas-lms,instructure/canvas-lms,HotChalk/canvas-lms,venturehive/canvas-lms,instructure/canvas-lms,Jyaasa/canvas-lms,fronteerio/canvas-lms,redconfetti/canvas-lms,redconfetti/canvas-lms,Jyaasa/canvas-lms,utkarshx/canvas-lms,djbender/canvas-lms,instructure/canvas-lms,antoniuslin/canvas-lms,wye0220/shindig-canvas,HotChalk/canvas-lms,redconfetti/canvas-lms,greyhwndz/canvas-lms,SwinburneOnline/canvas-lms,dgynn/canvas-lms,roxolan/canvas-lms,jay3126/canvas-lms,ShreniiNepal/shrenii_lmp,greyhwndz/canvas-lms,tgroshon/canvas-lms,utkarshx/canvas-lms,snehakachroo1/LSI_replica,grahamb/canvas-lms,skmezanul/canvas-lms,juoni/canvas-lms,SwinburneOnline/canvas-lms,wrdsb/canvas-lms,sfu/canvas-lms,gbleydon/canvas-lms,snehakachroo1/LSI_replica,samuels410/greatlakes-lms,tgroshon/canvas-lms,greyhwndz/canvas-lms,jay3126/canvas-lms,grahamb/canvas-lms,SwinburneOnline/canvas-lms,va7map/canvas-lms,ShreniiNepal/shrenii_lmp,shidao-fm/canvas-lms,wye0220/shindig-canvas,efrj/canvas-lms,usmschuck/canvas,djbender/canvas-lms,venturehive/canvas-lms,SwinburneOnline/canvas-lms,eCNAP/CANVAS,whalejasmine/canvas-lms,grahamb/canvas-lms,arrivu/arrivu-lms,matematikk-mooc/canvas-lms,arrivu/arrivu-lms,Unow/canvas-lms,Unow/canvas-lms,instructure/canvas-lms,venturehive/canvas-lms,narigone/canvas,kyroskoh/canvas-lms,sfu/canvas-lms,roxolan/canvas-lms,HotChalk/canvas-lms,dgynn/canvas-lms,shidao-fm/canvas-lms,sfu/canvas-lms,instructure/canvas-lms,sfu/canvas-lms,grahamb/canvas-lms,wye0220/shindig-canvas,efrj/canvas-lms,samuels410/greatlakes-lms,dgynn/canvas-lms,skmezanul/canvas-lms,AndranikMarkosyan/lms,whalejasmine/canvas-lms,sfu/canvas-lms,matematikk-mooc/canvas-lms,narigone/canvas,Rvor/canvas-lms,va7map/canvas-lms,matematikk-mooc/canvas-lms,antoniuslin/canvas-lms,sdeleon28/canvas-lms,skmezanul/canvas-lms,juoni/canvas-lms,arrivu/hoodemo,samuels410/greatlakes-lms,sdeleon28/canvas-lms,narigone/canvas,Rvor/canvas-lms,jay3126/canvas-lms,usmschuck/canvas,eCNAP/CANVAS,roxolan/canvas-lms,whalejasmine/canvas-lms,kyroskoh/canvas-lms,djbender/canvas-lms,arrivu/arrivu-lms,snehakachroo1/LSI_replica,gbleydon/canvas-lms,redconfetti/canvas-lms,usmschuck/canvas,snehakachroo1/LSI_replica,sfu/canvas-lms,gbleydon/canvas-lms,arrivu/hoodemo,skmezanul/canvas-lms,leftplusrightllc/canvas-lms,juoni/canvas-lms,AndranikMarkosyan/lms,wrdsb/canvas-lms,sdeleon28/canvas-lms,leftplusrightllc/canvas-lms,kyroskoh/canvas-lms,efrj/canvas-lms,sdeleon28/canvas-lms,va7map/canvas-lms,antoniuslin/canvas-lms,shidao-fm/canvas-lms,grahamb/canvas-lms,tgroshon/canvas-lms,utkarshx/canvas-lms,shidao-fm/canvas-lms,Jyaasa/canvas-lms,utkarshx/canvas-lms,instructure/canvas-lms,Jyaasa/canvas-lms,dgynn/canvas-lms,matematikk-mooc/canvas-lms,usmschuck/canvas,ShreniiNepal/shrenii_lmp,arrivu/hoodemo,wrdsb/canvas-lms,Unow/canvas-lms,AndranikMarkosyan/lms,Rvor/canvas-lms,fronteerio/canvas-lms,efrj/canvas-lms,greyhwndz/canvas-lms,eCNAP/CANVAS,AndranikMarkosyan/lms,kyroskoh/canvas-lms,samuels410/greatlakes-lms,leftplusrightllc/canvas-lms,eCNAP/CANVAS,juoni/canvas-lms,fronteerio/canvas-lms,fronteerio/canvas-lms,venturehive/canvas-lms,roxolan/canvas-lms