Sha256: 320caf122749ffe6a88f63d7000056b9fe8c9905f9ab287d5f5ef45523ef12ff

Contents?: true

Size: 808 Bytes

Versions: 6

Compression:

Stored size: 808 Bytes

Contents

require 'test_helper'

describe "Redis::RedisVersion" do
  def setup
    @store = Redis::Store.new
  end

  def teardown
    @store.quit
  end

  describe '#redis_version' do
    it 'returns redis version' do
      @store.redis_version.to_s.must_match(/^\d{1}\.\d{1,}\.\d{1,}$/)
    end
  end

  describe '#supports_redis_version?' do
    it 'returns true if redis version is greater or equal to required version' do
      @store.stubs(:redis_version).returns('2.8.19')
      @store.supports_redis_version?('2.6.0').must_equal(true)
      @store.supports_redis_version?('2.8.19').must_equal(true)
      @store.supports_redis_version?('2.8.20').must_equal(false)
      @store.supports_redis_version?('2.9.0').must_equal(false)
      @store.supports_redis_version?('3.0.0').must_equal(false)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
redis-store-1.9.1 test/redis/store/redis_version_test.rb
redis-store-1.9.0 test/redis/store/redis_version_test.rb
redis-store-1.8.2 test/redis/store/redis_version_test.rb
redis-store-1.8.1 test/redis/store/redis_version_test.rb
redis-store-1.8.0 test/redis/store/redis_version_test.rb
redis-store-1.6.0 test/redis/store/redis_version_test.rb