Sha256: 7e40b0e9c7d1d0cba94de175521e9c5d8a4b707a05aa3ce988b34d715a034e0a

Contents?: true

Size: 1.17 KB

Versions: 12

Compression:

Stored size: 1.17 KB

Contents

def clean_files
  ::Localtower::Tools.sql_drop_all_tables
  ::Localtower::Generators::Migration.new({}).remove_all_migrations
  Dir["#{Rails.root}/app/models/**/*.*"].each { |model_file| File.delete(model_file) }
end

def migration_files
  Dir["#{Rails.root}/db/migrate/*"]
end

def last_migration
  migration_files.sort.last
end

#============================
ENV['RAILS_ENV'] = 'test'

require File.expand_path('../dummy/config/environment.rb',  __FILE__)
require 'rspec/rails'
require 'factory_girl'

# require 'simplecov'
# Dir["#{File.join(File.dirname(__FILE__), '..')}/lib/**/*.rb"].each {|file| load file }

# SimpleCov.start do
#   add_group 'Lib', '../lib'
#   add_group 'App', '../app'
# end

Rails.application.eager_load!
Rails.backtrace_cleaner.remove_silencers!

RSpec.configure do |config|
  config.include FactoryGirl::Syntax::Methods

  config.mock_with :rspec
  config.use_transactional_fixtures = false
  config.infer_base_class_for_anonymous_controllers = true

  config.order = 123
  # config.order = 'random'

  config.before(:suite) do
    FactoryGirl.find_definitions
  end

  config.before(:all) do
    clean_files
  end

  config.after(:all) do
    clean_files
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
localtower-0.3.1 spec/spec_helper.rb
localtower-0.3.0 spec/spec_helper.rb
localtower-0.2.3 spec/spec_helper.rb
localtower-0.2.2 spec/spec_helper.rb
localtower-0.2.1 spec/spec_helper.rb
localtower-0.2.0 spec/spec_helper.rb
localtower-0.1.9 spec/spec_helper.rb
localtower-0.1.8 spec/spec_helper.rb
localtower-0.1.7 spec/spec_helper.rb
localtower-0.1.6 spec/spec_helper.rb
localtower-0.1.5 spec/spec_helper.rb
localtower-0.1.4 spec/spec_helper.rb