Sha256: ca24a936647462f044e44251d5691aa5815dca4e817cced90a94704b1e87c57c

Contents?: true

Size: 452 Bytes

Versions: 8

Compression:

Stored size: 452 Bytes

Contents

module TestDatabaseHelper
  module_function

  def test_database
    case mongo_orm
    when "mongoid"
      MongoidStore::Session.mongo_client
    when "mongo"
      Mongo::Client
        .new(["127.0.0.1:27017"], :database => test_database_name)
        .database
    end
  end

  def drop_collections_in(database)
    database.collections.select { |c| c.name !~ /^system/ }.each(&:drop)
  end

  def test_database_name
    "test_database"
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
mongo_session_store-3.2.1 spec/support/helpers/test_database_helper.rb
mongo_session_store-3.2.0 spec/support/helpers/test_database_helper.rb
mongo_session_store-3.1.0 spec/support/helpers/test_database_helper.rb
mongo_session_store-3.0.0 spec/support/helpers/test_database_helper.rb
mongo_session_store-3.0.0.beta.1 spec/support/helpers/test_database_helper.rb
mongo_session_store-rails-7.0.2 spec/support/helpers/test_database_helper.rb
mongo_session_store-rails-7.0.1 spec/support/helpers/test_database_helper.rb
mongo_session_store-rails-7.0.0 spec/support/helpers/test_database_helper.rb