Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
## in spec generate_and_import_fake_data( Security.find(:all), "Id\tBlp Performance Month\tBlp Performance Quarter\tDo Not Change This Date", "\#{obj.id}\t\#{rand*0.1}\t\#{rand*0.01}\t30/06/2007" ) ## in spec_helper def generate_and_import_fake_data(collection, header_string, data_string) fake_data = header_string.chomp + "\n" # .chomp + \n ensures there is always a single newline whether or not passed string has newline collection.each do |obj| fake_data << eval("\"#{data_string.chomp}\"").to_s + "\n" end post :import, {:data => fake_data} response.should be_success end
This paste will be private.
From the Design Piracy series on my blog: