Skip to content

Instantly share code, notes, and snippets.

@leesmith
Created February 6, 2014 21:37
Show Gist options
  • Select an option

  • Save leesmith/8852964 to your computer and use it in GitHub Desktop.

Select an option

Save leesmith/8852964 to your computer and use it in GitHub Desktop.
Control garbage collection in rspec
RSpec.configure do |config|
# ...snip
config.before(:each) do
DatabaseCleaner.start
GC.disable
end
config.after(:each) do
DatabaseCleaner.clean
GC.enable
end
# ...snip
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment