Sha256: 0b47aec7f41a525abb33a3776fd048fd429727eafad25d1580a6c27e903195d9

Contents?: true

Size: 1.31 KB

Versions: 1

Compression:

Stored size: 1.31 KB

Contents

$:.unshift(File.expand_path('../../lib', __FILE__))

require 'rubygems'
require 'bundler'

Bundler.require(:default, :test)

require 'plucky'

require 'fileutils'
require 'logger'
require 'pp'

if RUBY_ENGINE == "ruby" && RUBY_VERSION >= '2.3'
  require 'byebug'
end

log_dir = File.expand_path('../../log', __FILE__)
FileUtils.mkdir_p(log_dir)
Log = Logger.new(File.join(log_dir, 'test.log'))

LogBuddy.init :logger => Log

port = ENV.fetch "BOXEN_MONGODB_PORT", 27017
connection = Mongo::Client.new(["127.0.0.1:#{port.to_i}"], :logger => Log)
DB = connection.use('test').database

RSpec.configure do |config|
  config.filter_run :focused => true
  config.alias_example_to :fit, :focused => true
  config.alias_example_to :xit, :pending => true
  config.run_all_when_everything_filtered = true

  config.expect_with(:rspec) { |c| c.syntax = :should }
  config.mock_with(:rspec) { |c| c.syntax = :should }

  config.before(:suite) do
    DB.collections.reject { |collection|
      collection.name =~ /system\./
    }.each { |collection| collection.indexes.drop_all}
  end

  config.before(:each) do
    DB.collections.reject { |collection|
      collection.name =~ /system\./
    }.map(&:drop)
  end
end

operators = %w{gt lt gte lte ne in nin mod all size exists}
operators.delete('size') if RUBY_VERSION >= '1.9.1'
SymbolOperators = operators

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
plucky-0.8.0 spec/helper.rb