def should_never_happen(deadline_duration = 0.5, check_interval = 0.05)
      deadline = Time.now + deadline_duration
      while Time.now < deadline
        if yield
          raise "That which shouldn't happen happened anyway"
        else
          sleep(check_interval)
        end
      end
    end
def should_never_happen(deadline_duration = 0.5, check_interval = 0.05)
      deadline = Time.now + deadline_duration
      while Time.now < deadline
        if yield
          raise "That which shouldn't happen happened anyway"
        else
          sleep(check_interval)
        end
      end
    end
Asserts that something should never happen. This is done by checking that
 the given block never returns true. The block is called once every
 `check_interval` msec, until `deadline_duration` seconds have passed.
 If the block ever returns true, then an exception is raised.