Created
August 31, 2009 15:02
-
-
Save liangzan/178501 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Before('@upload') do | |
$upload_path = File.join(RAILS_ROOT, 'features', 'upload_files') | |
end | |
After('@upload') do | |
Dir.foreach($upload_path) do |file| | |
file_path = File.join($upload_path, file) | |
if file == '.' or file == '..' then next | |
else File.delete(file_path) | |
end | |
end | |
end | |
module UploadFileHelpers | |
def create_csv_file(file_name, csv_values) | |
file_path = File.join($upload_path, file_name) | |
File.open(file_path, "w") do |file| | |
file.puts csv_values | |
end | |
end | |
end | |
World(UploadFileHelpers) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment