Sha256: a5be83a60c46c652cf3ac2aefca5f4d8e3a20c53adeccbb290cd285820424754

Contents?: true

Size: 747 Bytes

Versions: 2

Compression:

Stored size: 747 Bytes

Contents

# -*- encoding : utf-8 -*-
require 'helper'
class DatabaseModuleTest < Test::Unit::TestCase
  context "DatabaseModule" do
    setup do
      #cleare previously assigned redis instance
      RedisModelExtension::Database.redis = nil
    end

    should "be initialized directly" do
      assert_nothing_raised do
        RedisModelExtension::Database.redis = Redis.new(host: "127.0.0.1", port: 6379, db: 0)
        RedisModelExtension::Database.redis.info
      end
      assert RedisModelExtension::Database.redis.is_a? Redis
    end

    should "be initialized from config" do
      assert_nothing_raised do
        RedisModelExtension::Database.redis.info
      end
      assert RedisModelExtension::Database.redis.is_a? Redis
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
redis-model-extension-0.3.5 test/test_database_module.rb
redis-model-extension-0.3.4 test/test_database_module.rb