Sha256: 9913ce40f70bc639534320c5829051be62f34e0c36c1b42d73f7a9e4f17eb0c8

Contents?: true

Size: 379 Bytes

Versions: 3

Compression:

Stored size: 379 Bytes

Contents

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
recordsearch-1.1.1 test/test_helper.rb
recordsearch-1.1.0 test/test_helper.rb
recordsearch-1.0.0 test/test_helper.rb