riak-ripple / ripple

A rich Ruby modeling layer for Riak, Basho's distributed database
Other
619 stars 152 forks source link

Spork-touched spec_helper + ripple generator #232

Closed krainboltgreene closed 12 years ago

krainboltgreene commented 12 years ago
require 'rubygems'
require 'spork'

Spork.prefork do
  # Spork.trap_class_method Mongoid, :load_models

  ENV['RAILS_ENV'] ||= 'test'
  require_relative '../config/environment'
  require 'rspec/rails'
  require 'capybara/rspec'

  # Require all of the RSpec Support libraries
  require_relative 'support/vcr'

  require 'ripple/test_server'
RSpec.configure do |config|
  config.before(:all){ Ripple::TestServer.setup }
  config.after(:each){ Ripple::TestServer.clear }

    # Set the default mocking library
    config.mock_with :rspec

    # Bring in the Mailer Macros
    # config.include MailerMacros

    # Including in VCR Macros
    config.extend VCR::RSpec::Macros

    # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
    # config.fixture_path = '#{::Rails.root}/spec/fixtures'

    # For use with ActiveRecord and Fixtures
    # config.use_transactional_fixtures = true

    # Define the cleaning strategy to clean the database
    DatabaseCleaner[:mongoid].strategy = :truncation

    # Reset all emails before each run
    # config.before(:each) { reset_email }

    # Clean the database after each run
    config.after(:each) { DatabaseCleaner.clean }

    # Only run tests that have this filter, if it exists
    config.filter_run :debug => true

    # Run all the tests when all the tests are filtered
    config.run_all_when_everything_filtered = true

    # Only Ryan Bates knows
    config.treat_symbols_as_metadata_keys_with_true_values = true

  end
end

Spork.each_run do
  # Require all of the factory files
  require_relative 'fabricators/account_fabricator'
  require_relative 'fabricators/scenario_fabricator'
end

Mostly cosmetic "issue"