On Fri, Jul 18, 2008 at 8:11 PM, Keith McDonnell <[EMAIL PROTECTED]> wrote: > I wrote an ActiveRecord extension to emulate a db cursor: > http://pastie.org/236367 > As you can see, the spec doesn't really ensure that the records are fetched > in chunks. I'd like to mock the call to AR find and ensure that it's called > with an incrementing offset.
I'm using cursors to walk a table with close to a million rows at times. I am just wrapping the action in a transaction and then declaring the cursor within the transaction and then walking the table with a find_by_sql with an SQL fetch command. It works well. Any reason you aren't doing it this way? Could just call it with a block... Mikel -- http://lindsaar.net/ Rails, RSpec and Life blog.... _______________________________________________ rspec-users mailing list [email protected] http://rubyforge.org/mailman/listinfo/rspec-users
