title: Where to put helper functions for rake tasks and test files in Ruby on Rails?
body: <p>In my Rails application I have a file <code>sample_data.rb</code> inside <code>/lib/tasks</code> as well as a bunch of test files inside my <code>/spec</code> directory.</p>
  
  <p>All these files often share common functionality such as:</p>
  
  <pre><code>def random_address
    [Faker::Address.street_address, Faker::Address.city].join("\n")
  end
  </code></pre>
  
  <p>Where should I put those helper functions? Is there some sort of convention on this?</p>
  
  <p>Thanks for any help!</p>