You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hyperspec uses the Filecache gem, which uses Time.now. But if Timecop freezes time in a spec, then Time.now is not returning the system time, and the Filecache does not work. This should be fixable by wrapping calls to the Filecache with the timecop return method (and a block.) But this does not in general work because Hyperspec tries to communicate the "return" to the client, even if the client is not running.
The following series of patches fixes the issue, and can be incorporated into the next point release:
moduleHyperSpecmoduleInternalmoduleControllerclass << self# wrap all calls with Timecop.return so the file cache gets the true system timedefcache_read(key)Timecop.return{file_cache.get(key)}enddefcache_write(key,value)Timecop.return{file_cache.set(key,value)}enddefcache_delete(key)Timecop.return{file_cache.delete(key)}rescueStandardErrornilendendendendendclassLolex# store all lolex updates unless hyper_spec is mounteddefself.evaluate_ruby(&block)if@capybara_page&.instance_variable_get('@hyper_spec_mounted')@capybara_page.internal_evaluate_ruby(yield)elsepending_evaluations << blockendendend
The text was updated successfully, but these errors were encountered:
Hyperspec uses the Filecache gem, which uses Time.now. But if Timecop freezes time in a spec, then Time.now is not returning the system time, and the Filecache does not work. This should be fixable by wrapping calls to the Filecache with the timecop return method (and a block.) But this does not in general work because Hyperspec tries to communicate the "return" to the client, even if the client is not running.
The following series of patches fixes the issue, and can be incorporated into the next point release:
The text was updated successfully, but these errors were encountered: