Leave a comment

Cleanup files created with Rspec


So I guess I just never took the time to look but our main Ruby on Rails web application creates a lot of files during testing.  Now I am not talking about database anything here.  We create icons, and pdf’s and rtf files during our Rspec test suite.

Just add this to you spec_helper.rb file:


config.after(:suite) do
  FileUtils.rm_rf(Dir["#{Rails.root}/public/system"])
end

Obviously change the directory to the correct one.

Hope that helps somebody 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: