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

require 'active_support/core_ext'
require 'simplecov'
require 'coveralls'

SimpleCov.formatter = Coveralls::SimpleCov::Formatter
SimpleCov.start do
  add_filter '/spec'
  base_path = "#{File.dirname(__FILE__)}/../"
  Dir["#{base_path}lib/casino_core/*.rb"].each do |f|
    f.gsub!(/\A#{base_path}(.+)\.rb\z/, '\1')
    name = File.basename(f).humanize.pluralize
    add_group name, f
  end
end

require 'coveralls'
Coveralls.wear!

require 'database_cleaner'
require 'logger'
require 'webmock/rspec'
require 'casino_core'

# This file was generated by the `rspec --init` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# Require this file using `require "spec_helper"` to ensure that it is only
# loaded once.
#
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
