Sha256: 20798ac7a6190e9703a8dcf8bfc68cde77dc1b45bcc0d30cead0939d274e84c6
Contents?: true
Size: 1.03 KB
Versions: 6
Compression:
Stored size: 1.03 KB
Contents
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) $LOAD_PATH.unshift(File.dirname(__FILE__)) require 'rspec' require 'active_record' # for Flydata::Heroku require 'protected_attributes' # Change FLYDATA_HOME to tempdir temp_dir_path = Dir.mktmpdir ENV['FLYDATA_HOME'] = temp_dir_path # Set dummy flydata_api_host file File.open(File.join(temp_dir_path, 'flydata_api_host'), 'w') do |f| f.write('http://0.0.0.0:3000') end 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
Version data entries
6 entries across 6 versions & 1 rubygems