Skip to content

Instantly share code, notes, and snippets.

@elhu
Created January 29, 2013 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elhu/4664248 to your computer and use it in GitHub Desktop.
Save elhu/4664248 to your computer and use it in GitHub Desktop.
# Setup step
stub(Version.just_updated).paginate(:page => nil, :per_page => 50){ [@version_2, @version_3, @version_4] }
stub(Version.just_updated).paginate(:page => 2, :per_page => 50){ [@version_4, @version_3, @version_2] }
stub(Version.just_updated).paginate do |args|
raise args.inspect
end
# Test
should "raise an exception" do
pp Version.just_updated.paginate(:page => 3, :per_page => 50) #=> []
pp Version.just_updated.paginate(:page => 2, :per_page => 50) #=> []
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment