Sha256: ed71cb3488c9d029c10f972decbfb3f7d5e6868c1b30fd6d5e9886256e0dd6e8

Contents?: true

Size: 796 Bytes

Versions: 21

Compression:

Stored size: 796 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

require 'redis/objects'
Redis::Objects.redis = REDIS_HANDLE

$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../../redis-namespace/lib')
begin
  require 'redis/namespace'

  describe 'Redis::Namespace compat' do
    it "tests the compatibility of Hash and ::Hash conflicts" do
      ns = Redis::Namespace.new("resque", :redis => REDIS_HANDLE)
      ns.instance_eval { rem_namespace({"resque:x" => nil}) }.should == {"x"=>nil}
      class Foo
        include Redis::Objects
      end
      ns.instance_eval { rem_namespace({"resque:x" => nil}) }.should == {"x"=>nil}
    end
  end

rescue LoadError
  # Redis::Namespace not installed
  puts "Skipping Redis::Namespace tests as redis-namespace is not installed"
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
redis-objects-0.7.0 spec/redis_namespace_compat_spec.rb