Skip to content

Commit

Permalink
Clean Carrierwave upload directory after every example
Browse files Browse the repository at this point in the history
Previously we were only cleaning this directory once at the end of the
sutie. I'm about to add some examples which need to make assertions
about files and directories within this upload directory and doing so
would've been much harder without this change.

There is probably some performance cost to calling this after every
spec, but I think it's pretty negligible.
  • Loading branch information
floehopper committed Jan 9, 2018
1 parent 8b4cb27 commit 0da9780
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spec/support/carrier_wave.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ def clean_upload_directory!
FileUtils.rm_rf(Dir["#{AssetManager.carrier_wave_store_base_dir}/[^.]*"])
end

RSpec.configuration.after(:suite) do
RSpec.configuration.after do
clean_upload_directory!
end

0 comments on commit 0da9780

Please sign in to comment.