• E
    Prevent race condition when resetting time stubs · 6122d2bf
    Eugene Kenny 提交于
    If the current thread is preempted after the stub has been removed but
    before the original method has been restored, then the other thread will
    get a `NoMethodError` when it tries to call the method.
    
    Using `silence_redefinition_of_method` instead of `undef_method` ensures
    that either the stub or the original method is always in place.
    6122d2bf
time_helpers.rb 7.0 KB