Skip to content

Instantly share code, notes, and snippets.

@clr
Created August 20, 2012 21:01
Show Gist options
  • Select an option

  • Save clr/3407861 to your computer and use it in GitHub Desktop.

Select an option

Save clr/3407861 to your computer and use it in GitHub Desktop.
require File.expand_path('../helper', __FILE__)
class TestExample < Test::Unit::TestCase
def setup
threads = []
3.times do |line|
threads << Thread.new do
data = File.readlines(File.join(ROOT_DIR,'test','data'))[line]
data.split(',').each do |value|
DataPointDocument.create(:value => value.to_i)
end
end
end
threads.each do |t|
t.join
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment