Sha256: 001a386485b4c4603324ffc84e4424cd1bff6ccd2498ac567c2f74b7153f96a4

Contents?: true

Size: 1.18 KB

Versions: 7

Compression:

Stored size: 1.18 KB

Contents

ENV['RAILS_ENV'] ||= 'test'

require 'simplecov'
require 'simplecov-rcov'
SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter
SimpleCov.start do
  add_filter "/spec/"
end

require 'active_record'
require 'database_cleaner'
require 'rails'
require 'notifiable'
require 'gcm'
require 'webmock/rspec'
require File.expand_path("../../lib/notifiable/gcm/spacialdb",  __FILE__)
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }

db_path = 'spec/support/db/test.sqlite3'
DatabaseCleaner.strategy = :truncation

RSpec.configure do |config|  
  config.mock_with :rspec
  config.order = "random"
  
  config.before(:all) {
    
    # DB setup
    ActiveRecord::Base.establish_connection(
     { :adapter => 'sqlite3',
       :database => db_path,
       :pool => 5,
       :timeout => 5000}
    )
    
    ActiveRecord::Migration.verbose = false
    ActiveRecord::Migrator.migrate "spec/support/db/migrate"
    
    # todo start stub
  }
  
  config.before(:each) {
    DatabaseCleaner.start
    # todo clear stub state
  }
  
  config.after(:each) {
    DatabaseCleaner.clean
  }
  
  config.after(:all) {
    # todo close stub
    
    # drop the database
    File.delete(db_path)
  }
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
notifiable-gcm-spacialdb-0.4.1 spec/spec_helper.rb
notifiable-gcm-spacialdb-0.4.0 spec/spec_helper.rb
notifiable-gcm-spacialdb-0.3.0 spec/spec_helper.rb
notifiable-gcm-spacialdb-0.2.1 spec/spec_helper.rb
notifiable-gcm-spacialdb-0.2.0 spec/spec_helper.rb
notifiable-gcm-spacialdb-0.1.4 spec/spec_helper.rb
notifiable-gcm-spacialdb-0.1.3 spec/spec_helper.rb