Sha256: cba159db8a6c820363c1d0f8b9bd1548c9ea0f725ab662fa26d16c0b5dd49f67

Contents?: true

Size: 1.76 KB

Versions: 50

Compression:

Stored size: 1.76 KB

Contents

base_path = File.expand_path(File.join(File.basename(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(base_path) unless $LOAD_PATH.include?(base_path)

require 'rspec'
require 'database_cleaner'
require 'dm-rspec'
require 'dm-transactions'
require 'simplecov'

SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter
SimpleCov.add_filter "/spec/"
SimpleCov.add_filter do |source_file|
  source_file.lines.count < 3
end

SimpleCov.add_group "Internal Data Models", "data_models"
SimpleCov.add_group "Internal Data Observers", "data_observers"
SimpleCov.add_group "Server Message Models", "message_models"
SimpleCov.add_group "Message Processors", "message_processors"

SimpleCov.start

require 'patronus_fati'

# Setup the database in memory
DataMapper.setup(:default, 'sqlite::memory:')
DataMapper.finalize
DataMapper.auto_upgrade!

RSpec.configure do |config|
  config.include(DataMapper::Matchers)

  config.before(:suite) do
    DatabaseCleaner.strategy = :transaction
    DatabaseCleaner.clean_with(:truncation)
  end

  config.around(:each) do |example|
    DatabaseCleaner.cleaning do
      example.run
    end
  end

  config.expect_with :rspec do |expectations|
    expectations.include_chain_clauses_in_custom_matcher_descriptions = true
  end

  config.mock_with :rspec do |mocks|
    mocks.verify_partial_doubles = true
    mocks.verify_doubled_constant_names = true
  end

  config.filter_run :focus
  config.run_all_when_everything_filtered = true
  config.disable_monkey_patching!

  # Normally I'd run with this on, but datamapper uses instance variables
  # without intializing them quite a bit.
  config.warnings = false

  if config.files_to_run.one?
    config.default_formatter = 'doc'
  end

  config.profile_examples = 3
  config.order = :random

  Kernel.srand(config.seed)
end

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
patronus_fati-0.9.10 spec/spec_helper.rb
patronus_fati-0.9.9 spec/spec_helper.rb
patronus_fati-0.9.8 spec/spec_helper.rb
patronus_fati-0.9.7 spec/spec_helper.rb
patronus_fati-0.9.6 spec/spec_helper.rb
patronus_fati-0.9.5 spec/spec_helper.rb
patronus_fati-0.9.4 spec/spec_helper.rb
patronus_fati-0.9.3 spec/spec_helper.rb
patronus_fati-0.9.2 spec/spec_helper.rb
patronus_fati-0.9.1 spec/spec_helper.rb
patronus_fati-0.9.0 spec/spec_helper.rb
patronus_fati-0.8.18 spec/spec_helper.rb
patronus_fati-0.8.17 spec/spec_helper.rb
patronus_fati-0.8.16 spec/spec_helper.rb
patronus_fati-0.8.15 spec/spec_helper.rb
patronus_fati-0.8.14 spec/spec_helper.rb
patronus_fati-0.8.13 spec/spec_helper.rb
patronus_fati-0.8.12 spec/spec_helper.rb
patronus_fati-0.8.11 spec/spec_helper.rb
patronus_fati-0.8.10 spec/spec_helper.rb