Sha256: b3e039cd384490fd40f0a9d2f61728f46f6728b610b259f0b7865c0f3d62864b

Contents?: true

Size: 1.05 KB

Versions: 2

Compression:

Stored size: 1.05 KB

Contents

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

require 'timeout'
require 'database_cleaner'
require 'active_record'
require 'notifiable'
require 'notifiable/apns/grocer'
require 'grocer'
require 'byebug'

Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }

# Setup ActiveRecord db connection
ActiveRecord::Base.establish_connection(YAML.load_file('config/database.yml')['test'])

RSpec.configure do |config|  
  config.mock_with :rspec
  config.order = "random"
  
  config.before(:all) {
    DatabaseCleaner.strategy = :truncation
    Notifiable.notifier_classes[:apns] = Notifiable::Apns::Grocer::Stream
    Notifiable::App.define_configuration_accessors(Notifiable.notifier_classes)
        
    @grocer = Grocer.server(port: 2195)
    @grocer.accept
  }
  
  config.before(:each) {
    DatabaseCleaner.start
    @grocer.notifications.clear
  }
  
  config.after(:each) {
    DatabaseCleaner.clean
  }
  
  config.after(:all) {
    @grocer.close
  }
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
notifiable-apns-grocer-0.18.1 spec/spec_helper.rb
notifiable-apns-grocer-0.18.0 spec/spec_helper.rb