title: How to stub Array instance method using RSpec
body: <p>I have an instance method in String class who call the Array instance method "shuffle". In order for me to test the method using RSpec, I want to stub it.</p>
  
  <pre><code>vowels = %w(a e i o u y)
  vowels.shuffle
  </code></pre>
  
  <p>I tried:</p>
  
  <pre><code>Array.stub(:shuffle).and_return(%w(a e i o u y))
  [].stub(:shuffle).and_return(%w(a e i o u y))
  </code></pre>
  
  <p>But none work :( I am missing something here ? Mocking maybe ? But what should I mock then...</p>
  
  <p>Thank you.</p>