title: Test that method has a default value for an argument with RSpec
body: <p>How can I test that a method that takes an argument uses a default value if an argument is not provided?</p>
  
  <p><strong>Example</strong></p>
  
  <pre class="lang-ruby prettyprint-override"><code># this method shouldn't error out
  # if `Post.page_results` without a parameter
  class Post
    def self.page_results(page=1)
      page_size = 10
      start = (page - 1) * page_size
      finish = start + page_size
      return Page.all[start..finish]
    end
  end
  </code></pre>
  
  <p>How do I check in rspec that <code>page</code> equals <code>1</code> if <code>page_results</code> is called without argument?</p>