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

Version Path
flydata-0.2.1 spec/spec_helper.rb
flydata-0.2.0 spec/spec_helper.rb
flydata-0.1.15 spec/spec_helper.rb
flydata-0.1.13 spec/spec_helper.rb
flydata-0.1.12 spec/spec_helper.rb
flydata-0.1.11 spec/spec_helper.rb