$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) $LOAD_PATH.unshift(File.dirname(__FILE__)) require 'rspec' require 'active_record' # for Flydata::Heroku require 'flydata' # Requires supporting files with custom matchers and macros, etc, # in ./support/ and its subdirectories. Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f} RSpec.configure do |config| if defined? ActiveRecord # The ActiveRecord::Rollback exception will be caught by the transaction # block and roll back all the database changes after each spec. config.around do |example| if ActiveRecord::Base.connected? ActiveRecord::Base.transaction do example.run raise ActiveRecord::Rollback end end end end end