title: How do I test `rand()` with RSpec?
body: <p>I have a method that does something like this:</p>
  
  <pre><code>def some_method
    chance = rand(4)
    if chance == 1 do
      # logic here
    else
      # another logic here
    end
  end
  </code></pre>
  
  <p>When I use RSpec to test this method, <code>rand(4)</code> inside it always generates 0. I am not testing <code>rand</code> method of Rails, I am testing my method.
  What is a common practice to test my method?</p>