Sha256: cbfb93fec121aa8456599637a7e9b476ffe9eaec272f04eb1793ae80092ac432

Contents?: true

Size: 1.17 KB

Versions: 7

Compression:

Stored size: 1.17 KB

Contents

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'rspec'
require 'stratify-twitter'

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

require 'database_cleaner'

RSpec.configure do |config|
  config.color_enabled = true
  config.formatter = :progress

  # Configure RSpec to run focused specs, and also respect the alias 'fit' for focused specs
  config.filter_run :focused => true
  config.run_all_when_everything_filtered = true
  config.alias_example_to :fit, :focused => true

  config.extend VCR::RSpec::Macros

  # Configure RSpec to truncate the database before any spec tagged with ":database => true"
  DatabaseCleaner.strategy = :truncation
  DatabaseCleaner.orm = "mongoid"
  config.before(:each, :database => true) do
    DatabaseCleaner.clean
  end

  config.before(:suite) do
    initialize_mongoid_configuration
  end
end

def initialize_mongoid_configuration
  mongoid_config = YAML::load_file(File.join(File.dirname(__FILE__), "mongoid.yml"))
  Mongoid.from_hash(mongoid_config)
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
stratify-twitter-0.1.5 spec/spec_helper.rb
stratify-twitter-0.1.4.1 spec/spec_helper.rb
stratify-twitter-0.1.4 spec/spec_helper.rb
stratify-twitter-0.1.3 spec/spec_helper.rb
stratify-twitter-0.1.2 spec/spec_helper.rb
stratify-twitter-0.1.1 spec/spec_helper.rb
stratify-twitter-0.1.0 spec/spec_helper.rb