Sha256: 4aa96d365b09574815fc97c7153addcc97e76f7d51cc3320510a80d544f82863

Contents?: true

Size: 583 Bytes

Versions: 14

Compression:

Stored size: 583 Bytes

Contents

require 'test/test_helper'

class RedisAdapterTest < Test::Unit::TestCase
  def test_warn_on_disconnect_error
    if defined?(Redis)
      assert_nothing_raised do
        Redis.any_instance.stubs(:connect!)
        mocked_redis = stub("Redis")
        mocked_redis.expects(:client).raises(RuntimeError)
        redis_adapter = Vanity::Adapters::RedisAdapter.new({})
        redis_adapter.expects(:warn).with("Error while disconnecting from redis: RuntimeError")
        redis_adapter.stubs(:redis).returns(mocked_redis)
        redis_adapter.disconnect!
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 4 rubygems

Version Path
vanity-1.8.4 test/adapters/redis_adapter_test.rb
vanity-1.8.3 test/adapters/redis_adapter_test.rb
vanity-1.8.3.beta2 test/adapters/redis_adapter_test.rb
vanity-1.8.3.beta test/adapters/redis_adapter_test.rb
vanity-1.8.2 test/adapters/redis_adapter_test.rb
vanity-1.8.1 test/adapters/redis_adapter_test.rb
lookout-vanity-1.8.2 test/adapters/redis_adapter_test.rb
moses-vanity-1.8.1 test/adapters/redis_adapter_test.rb
moses-vanity-1.8.0 test/adapters/redis_adapter_test.rb
vanity-1.8.0 test/adapters/redis_adapter_test.rb
moses-vanity-1.7.1 test/adapters/redis_adapter_test.rb
fiverr-vanity-1.7.2 test/adapters/redis_adapter_test.rb
vanity-1.7.1 test/adapters/redis_adapter_test.rb
vanity-1.7.0 test/adapters/redis_adapter_test.rb