require 'test/unit' require File.dirname(__FILE__) + '/../lib/recordsearch' class TestDataSource < RecordSearch::DataSource def initialize(max=100) @max = max @cur = 0 end def next if @cur < @max @cur += 1 self.class.format(@cur - 1) end end def self.format(x) #TODO @max should have 10 digits or less "%010d\n" % x end end