redis-store 1.9.1 → 1.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/release.yml +13 -0
- data/.github/workflows/ci.yml +62 -0
- data/.github/workflows/publish.yml +32 -0
- data/.rubocop.yml +5 -11
- data/Appraisals +8 -1
- data/Rakefile +1 -1
- data/gemfiles/redis_4_6_x.gemfile +7 -0
- data/gemfiles/redis_5_x.gemfile +7 -0
- data/lib/redis/store/namespace.rb +1 -1
- data/lib/redis/store/ttl.rb +7 -2
- data/lib/redis/store/version.rb +1 -1
- data/redis-store.gemspec +1 -1
- data/test/redis/distributed_store_test.rb +13 -13
- data/test/redis/store/factory_test.rb +44 -44
- data/test/redis/store/namespace_test.rb +21 -21
- data/test/redis/store/redis_version_test.rb +6 -6
- data/test/redis/store/serialization_test.rb +46 -44
- data/test/redis/store/ttl_test.rb +6 -21
- data/test/redis/store/version_test.rb +1 -1
- data/test/redis/store_test.rb +7 -7
- metadata +13 -9
- data/.travis.yml +0 -39
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 7a70e9a1e720591e28f5abee4cbfff877503f808a9318143234579ea942dc073
         | 
| 4 | 
            +
              data.tar.gz: 037aa5824d933374d37e0f922c8992034ed48d05bf00069be6040d52a6706b2e
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: fe1f61f58277a706a19100e85433bd7177b23b8245c6f1354cbe49abdcb2aa9abed9a3956686b074d5c9edb7006f5dbb8f8715d579f316832eecf711a656dab1
         | 
| 7 | 
            +
              data.tar.gz: 22d18ed2621e2075d2e02a7f830d4ad2de45f834405f62650e9f41f19bff6b6d3a5017d1247fe0de893e5d3c21f71c3aed63f742c8823d05bef5cf6148c74c4d
         | 
    
        data/.github/release.yml
    ADDED
    
    | @@ -0,0 +1,13 @@ | |
| 1 | 
            +
            changelog:
         | 
| 2 | 
            +
              exclude:
         | 
| 3 | 
            +
                labels: [dependencies]
         | 
| 4 | 
            +
                authors: [renovate-bot]
         | 
| 5 | 
            +
              categories:
         | 
| 6 | 
            +
                - title: Breaking Changes
         | 
| 7 | 
            +
                  labels: [breaking]
         | 
| 8 | 
            +
                - title: New Features
         | 
| 9 | 
            +
                  labels: [enhancement]
         | 
| 10 | 
            +
                - title: Bug Fixes
         | 
| 11 | 
            +
                  labels: [bug]
         | 
| 12 | 
            +
                - title: Other Changes
         | 
| 13 | 
            +
                  labels: ["*"]
         | 
| @@ -0,0 +1,62 @@ | |
| 1 | 
            +
            name: CI
         | 
| 2 | 
            +
            on:
         | 
| 3 | 
            +
              push:
         | 
| 4 | 
            +
                branches-ignore: [master]
         | 
| 5 | 
            +
                tags-ignore: [v*]
         | 
| 6 | 
            +
            concurrency:
         | 
| 7 | 
            +
              group: ${{ github.workflow }}-${{ github.ref }}
         | 
| 8 | 
            +
              cancel-in-progress: true
         | 
| 9 | 
            +
            jobs:
         | 
| 10 | 
            +
              test:
         | 
| 11 | 
            +
                name: "test (ruby: ${{ matrix.ruby }}, redis.rb: ${{ matrix.redis }})"
         | 
| 12 | 
            +
                runs-on: ubuntu-latest
         | 
| 13 | 
            +
                continue-on-error: ${{ contains(matrix.ruby, 'head') }}
         | 
| 14 | 
            +
                strategy:
         | 
| 15 | 
            +
                  fail-fast: false
         | 
| 16 | 
            +
                  matrix:
         | 
| 17 | 
            +
                    ruby:
         | 
| 18 | 
            +
                      - "2.7"
         | 
| 19 | 
            +
                      - "3.0"
         | 
| 20 | 
            +
                      - "3.1"
         | 
| 21 | 
            +
                      # - 'head'
         | 
| 22 | 
            +
                      - "jruby"
         | 
| 23 | 
            +
                      # - 'jruby-head'
         | 
| 24 | 
            +
                      - "truffleruby"
         | 
| 25 | 
            +
                      # - 'truffleruby-head'
         | 
| 26 | 
            +
                    redis:
         | 
| 27 | 
            +
                      - 4_0_x
         | 
| 28 | 
            +
                      - 4_1_x
         | 
| 29 | 
            +
                      - 4_x
         | 
| 30 | 
            +
                env:
         | 
| 31 | 
            +
                  BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/redis_${{ matrix.redis }}.gemfile
         | 
| 32 | 
            +
                services:
         | 
| 33 | 
            +
                  redis:
         | 
| 34 | 
            +
                    image: redis
         | 
| 35 | 
            +
                    ports:
         | 
| 36 | 
            +
                      - 6379:6379
         | 
| 37 | 
            +
                  distributed1:
         | 
| 38 | 
            +
                    image: redis
         | 
| 39 | 
            +
                    ports:
         | 
| 40 | 
            +
                      - 6380:6380
         | 
| 41 | 
            +
                  distributed2:
         | 
| 42 | 
            +
                    image: redis
         | 
| 43 | 
            +
                    ports:
         | 
| 44 | 
            +
                      - 6381:6381
         | 
| 45 | 
            +
                steps:
         | 
| 46 | 
            +
                  - uses: actions/checkout@v3
         | 
| 47 | 
            +
                  - uses: ruby/setup-ruby@v1
         | 
| 48 | 
            +
                    with:
         | 
| 49 | 
            +
                      ruby-version: ${{ matrix.ruby }}
         | 
| 50 | 
            +
                      bundler-cache: true
         | 
| 51 | 
            +
                  - run: bundle exec rake
         | 
| 52 | 
            +
              lint:
         | 
| 53 | 
            +
                runs-on: ubuntu-latest
         | 
| 54 | 
            +
                steps:
         | 
| 55 | 
            +
                  - uses: actions/checkout@v3
         | 
| 56 | 
            +
                    with:
         | 
| 57 | 
            +
                      fetch-depth: 0
         | 
| 58 | 
            +
                  - uses: ruby/setup-ruby@v1
         | 
| 59 | 
            +
                    with:
         | 
| 60 | 
            +
                      ruby-version: 3.1
         | 
| 61 | 
            +
                      bundler-cache: true
         | 
| 62 | 
            +
                  - run: bundle exec rake lint
         | 
| @@ -0,0 +1,32 @@ | |
| 1 | 
            +
            name: Publish
         | 
| 2 | 
            +
            on:
         | 
| 3 | 
            +
              push:
         | 
| 4 | 
            +
                tags: [v*]
         | 
| 5 | 
            +
            permissions:
         | 
| 6 | 
            +
              contents: write
         | 
| 7 | 
            +
            concurrency:
         | 
| 8 | 
            +
              group: ${{ github.workflow }}-${{ github.ref }}
         | 
| 9 | 
            +
              cancel-in-progress: true
         | 
| 10 | 
            +
            jobs:
         | 
| 11 | 
            +
              release:
         | 
| 12 | 
            +
                runs-on: ubuntu-latest
         | 
| 13 | 
            +
                steps:
         | 
| 14 | 
            +
                  - uses: actions/checkout@v3
         | 
| 15 | 
            +
                  - uses: ruby/setup-ruby@v1
         | 
| 16 | 
            +
                    with:
         | 
| 17 | 
            +
                      ruby-version: "3.1"
         | 
| 18 | 
            +
                      bundler-cache: true
         | 
| 19 | 
            +
                  - run: |
         | 
| 20 | 
            +
                      mkdir -p ~/.gem
         | 
| 21 | 
            +
                      cat << EOF > ~/.gem/credentials
         | 
| 22 | 
            +
                      ---
         | 
| 23 | 
            +
                      :rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}
         | 
| 24 | 
            +
                      EOF
         | 
| 25 | 
            +
             | 
| 26 | 
            +
                      chmod 0600 ~/.gem/credentials
         | 
| 27 | 
            +
                  - run: bundle exec rake release
         | 
| 28 | 
            +
                  - uses: softprops/action-gh-release@v1
         | 
| 29 | 
            +
                    with:
         | 
| 30 | 
            +
                      files: "*.gem"
         | 
| 31 | 
            +
                      generate_release_notes: true
         | 
| 32 | 
            +
                      prerelease: ${{ contains(github.ref, '.pre') }}
         | 
    
        data/.rubocop.yml
    CHANGED
    
    | @@ -5,18 +5,12 @@ AllCops: | |
| 5 5 | 
             
              # to ignore them, so only the ones explicitly set in this file are enabled.
         | 
| 6 6 | 
             
              DisabledByDefault: true
         | 
| 7 7 | 
             
              Exclude:
         | 
| 8 | 
            -
                -  | 
| 8 | 
            +
                - "**/vendor/**/*"
         | 
| 9 9 |  | 
| 10 10 | 
             
            # Prefer &&/|| over and/or.
         | 
| 11 11 | 
             
            Style/AndOr:
         | 
| 12 12 | 
             
              Enabled: true
         | 
| 13 13 |  | 
| 14 | 
            -
            # Do not use braces for hash literals when they are the last argument of a
         | 
| 15 | 
            -
            # method call.
         | 
| 16 | 
            -
            Style/BracesAroundHashParameters:
         | 
| 17 | 
            -
              Enabled: true
         | 
| 18 | 
            -
              EnforcedStyle: context_dependent
         | 
| 19 | 
            -
             | 
| 20 14 | 
             
            # Align comments with method definitions.
         | 
| 21 15 | 
             
            Layout/CommentIndentation:
         | 
| 22 16 | 
             
              Enabled: true
         | 
| @@ -46,7 +40,7 @@ Layout/FirstParameterIndentation: | |
| 46 40 | 
             
            # extra level of indentation.
         | 
| 47 41 | 
             
            Layout/IndentationConsistency:
         | 
| 48 42 | 
             
              Enabled: true
         | 
| 49 | 
            -
              EnforcedStyle:  | 
| 43 | 
            +
              EnforcedStyle: indented_internal_methods
         | 
| 50 44 |  | 
| 51 45 | 
             
            # Two spaces, no tabs (for indentation).
         | 
| 52 46 | 
             
            Layout/IndentationWidth:
         | 
| @@ -99,11 +93,11 @@ Layout/SpaceInsideParens: | |
| 99 93 | 
             
              Enabled: true
         | 
| 100 94 |  | 
| 101 95 | 
             
            # Detect hard tabs, no hard tabs.
         | 
| 102 | 
            -
            Layout/ | 
| 96 | 
            +
            Layout/IndentationStyle:
         | 
| 103 97 | 
             
              Enabled: true
         | 
| 104 98 |  | 
| 105 99 | 
             
            # Blank lines should not have any spaces.
         | 
| 106 | 
            -
            Layout/ | 
| 100 | 
            +
            Layout/TrailingEmptyLines:
         | 
| 107 101 | 
             
              Enabled: true
         | 
| 108 102 |  | 
| 109 103 | 
             
            # No trailing whitespace.
         | 
| @@ -111,7 +105,7 @@ Layout/TrailingWhitespace: | |
| 111 105 | 
             
              Enabled: true
         | 
| 112 106 |  | 
| 113 107 | 
             
            # Use quotes for string literals when they are enough.
         | 
| 114 | 
            -
            Style/ | 
| 108 | 
            +
            Style/RedundantPercentQ:
         | 
| 115 109 | 
             
              Enabled: true
         | 
| 116 110 |  | 
| 117 111 | 
             
            # Align `end` with the matching keyword or starting expression except for
         | 
    
        data/Appraisals
    CHANGED
    
    | @@ -1,4 +1,3 @@ | |
| 1 | 
            -
             | 
| 2 1 | 
             
            appraise "redis_4_0_x" do
         | 
| 3 2 | 
             
              gem "redis", "~> 4.0.0"
         | 
| 4 3 | 
             
            end
         | 
| @@ -7,6 +6,14 @@ appraise "redis_4_1_x" do | |
| 7 6 | 
             
              gem "redis", "~> 4.1.0"
         | 
| 8 7 | 
             
            end
         | 
| 9 8 |  | 
| 9 | 
            +
            appraise "redis_4_6_x" do
         | 
| 10 | 
            +
              gem "redis", "~> 4.6.0"
         | 
| 11 | 
            +
            end
         | 
| 12 | 
            +
             | 
| 10 13 | 
             
            appraise "redis_4_x" do
         | 
| 11 14 | 
             
              gem "redis", "~> 4.0"
         | 
| 12 15 | 
             
            end
         | 
| 16 | 
            +
             | 
| 17 | 
            +
            appraise "redis_5_x" do
         | 
| 18 | 
            +
              gem "redis", "~> 5.0"
         | 
| 19 | 
            +
            end
         | 
    
        data/Rakefile
    CHANGED
    
    
| @@ -47,7 +47,7 @@ class Redis | |
| 47 47 | 
             
                    if match
         | 
| 48 48 | 
             
                      namespace(match) do |pattern|
         | 
| 49 49 | 
             
                        cursor, keys = super(cursor, match: pattern, **kwargs)
         | 
| 50 | 
            -
                        [ cursor, keys.map{ |key| strip_namespace(key) } ]
         | 
| 50 | 
            +
                        [ cursor, keys.map { |key| strip_namespace(key) } ]
         | 
| 51 51 | 
             
                      end
         | 
| 52 52 | 
             
                    else
         | 
| 53 53 | 
             
                      super(cursor, **kwargs)
         | 
    
        data/lib/redis/store/ttl.rb
    CHANGED
    
    | @@ -20,8 +20,13 @@ class Redis | |
| 20 20 | 
             
                  protected
         | 
| 21 21 | 
             
                    def setnx_with_expire(key, value, ttl, options = {})
         | 
| 22 22 | 
             
                      with_multi_or_pipelined(options) do |transaction|
         | 
| 23 | 
            -
                        transaction. | 
| 24 | 
            -
             | 
| 23 | 
            +
                        if transaction.is_a?(Redis::Store) # for redis < 4.6
         | 
| 24 | 
            +
                          setnx(key, value, :raw => true)
         | 
| 25 | 
            +
                          expire(key, ttl)
         | 
| 26 | 
            +
                        else
         | 
| 27 | 
            +
                          transaction.setnx(key, value)
         | 
| 28 | 
            +
                          transaction.expire(key, ttl)
         | 
| 29 | 
            +
                        end
         | 
| 25 30 | 
             
                      end
         | 
| 26 31 | 
             
                    end
         | 
| 27 32 |  | 
    
        data/lib/redis/store/version.rb
    CHANGED
    
    
    
        data/redis-store.gemspec
    CHANGED
    
    | @@ -16,7 +16,7 @@ Gem::Specification.new do |s| | |
| 16 16 | 
             
              s.require_paths = ["lib"]
         | 
| 17 17 | 
             
              s.license       = 'MIT'
         | 
| 18 18 |  | 
| 19 | 
            -
              s.add_dependency 'redis', '>= 4', '<  | 
| 19 | 
            +
              s.add_dependency 'redis', '>= 4', '< 6'
         | 
| 20 20 |  | 
| 21 21 | 
             
              s.add_development_dependency 'rake',     '>= 12.3.3'
         | 
| 22 22 | 
             
              s.add_development_dependency 'bundler'
         | 
| @@ -19,7 +19,7 @@ describe "Redis::DistributedStore" do | |
| 19 19 | 
             
                dmr = Redis::DistributedStore.new [ :host => "localhost", :port => "6380", :db => "1" ]
         | 
| 20 20 | 
             
                dmr.ring.nodes.size == 1
         | 
| 21 21 | 
             
                mr = dmr.ring.nodes.first
         | 
| 22 | 
            -
                mr.to_s.must_equal("Redis Client connected to localhost:6380 against DB 1")
         | 
| 22 | 
            +
                _(mr.to_s).must_equal("Redis Client connected to localhost:6380 against DB 1")
         | 
| 23 23 | 
             
              end
         | 
| 24 24 |  | 
| 25 25 | 
             
              it "forces reconnection" do
         | 
| @@ -32,11 +32,11 @@ describe "Redis::DistributedStore" do | |
| 32 32 |  | 
| 33 33 | 
             
              it "sets an object" do
         | 
| 34 34 | 
             
                @dmr.set "rabbit", @white_rabbit
         | 
| 35 | 
            -
                @dmr.get("rabbit").must_equal(@white_rabbit)
         | 
| 35 | 
            +
                _(@dmr.get("rabbit")).must_equal(@white_rabbit)
         | 
| 36 36 | 
             
              end
         | 
| 37 37 |  | 
| 38 38 | 
             
              it "gets an object" do
         | 
| 39 | 
            -
                @dmr.get("rabbit").must_equal(@rabbit)
         | 
| 39 | 
            +
                _(@dmr.get("rabbit")).must_equal(@rabbit)
         | 
| 40 40 | 
             
              end
         | 
| 41 41 |  | 
| 42 42 | 
             
              it "mget" do
         | 
| @@ -44,9 +44,9 @@ describe "Redis::DistributedStore" do | |
| 44 44 | 
             
                begin
         | 
| 45 45 | 
             
                  @dmr.mget "rabbit", "rabbit2" do |rabbits|
         | 
| 46 46 | 
             
                    rabbit, rabbit2 = rabbits
         | 
| 47 | 
            -
                    rabbits.length.must_equal(2)
         | 
| 48 | 
            -
                    rabbit.must_equal(@rabbit)
         | 
| 49 | 
            -
                    rabbit2.must_equal(@white_rabbit)
         | 
| 47 | 
            +
                    _(rabbits.length).must_equal(2)
         | 
| 48 | 
            +
                    _(rabbit).must_equal(@rabbit)
         | 
| 49 | 
            +
                    _(rabbit2).must_equal(@white_rabbit)
         | 
| 50 50 | 
             
                  end
         | 
| 51 51 | 
             
                rescue Redis::Distributed::CannotDistribute
         | 
| 52 52 | 
             
                  # Not supported on redis-rb < 4, and hence Ruby < 2.2.
         | 
| @@ -57,9 +57,9 @@ describe "Redis::DistributedStore" do | |
| 57 57 | 
             
                @dmr.set "rabbit2", @white_rabbit
         | 
| 58 58 | 
             
                begin
         | 
| 59 59 | 
             
                  result = @dmr.mapped_mget("rabbit", "rabbit2")
         | 
| 60 | 
            -
                  result.keys.must_equal %w[ rabbit rabbit2 ]
         | 
| 61 | 
            -
                  result["rabbit"].must_equal @rabbit
         | 
| 62 | 
            -
                  result["rabbit2"].must_equal @white_rabbit
         | 
| 60 | 
            +
                  _(result.keys).must_equal %w[ rabbit rabbit2 ]
         | 
| 61 | 
            +
                  _(result["rabbit"]).must_equal @rabbit
         | 
| 62 | 
            +
                  _(result["rabbit2"]).must_equal @white_rabbit
         | 
| 63 63 | 
             
                rescue Redis::Distributed::CannotDistribute
         | 
| 64 64 | 
             
                  # Not supported on redis-rb < 4, and hence Ruby < 2.2.
         | 
| 65 65 | 
             
                end
         | 
| @@ -70,7 +70,7 @@ describe "Redis::DistributedStore" do | |
| 70 70 | 
             
                                                { :host => "localhost", :port => "6380", :db => 0 },
         | 
| 71 71 | 
             
                                                { :host => "localhost", :port => "6381", :db => 0 }
         | 
| 72 72 | 
             
                                            ], replicas: 1024
         | 
| 73 | 
            -
                dmr.ring.replicas.must_equal 1024
         | 
| 73 | 
            +
                _(dmr.ring.replicas).must_equal 1024
         | 
| 74 74 | 
             
              end
         | 
| 75 75 |  | 
| 76 76 | 
             
              it "uses a custom ring object" do
         | 
| @@ -79,8 +79,8 @@ describe "Redis::DistributedStore" do | |
| 79 79 | 
             
                                                      { :host => "localhost", :port => "6380", :db => 0 },
         | 
| 80 80 | 
             
                                                      { :host => "localhost", :port => "6381", :db => 0 }
         | 
| 81 81 | 
             
                                                  ], ring: my_ring
         | 
| 82 | 
            -
                dmr.ring.must_equal my_ring
         | 
| 83 | 
            -
                dmr.ring.nodes.length.must_equal 2
         | 
| 82 | 
            +
                _(dmr.ring).must_equal my_ring
         | 
| 83 | 
            +
                _(dmr.ring.nodes.length).must_equal 2
         | 
| 84 84 | 
             
              end
         | 
| 85 85 |  | 
| 86 86 | 
             
              describe '#redis_version' do
         | 
| @@ -108,4 +108,4 @@ describe "Redis::DistributedStore" do | |
| 108 108 | 
             
                  @dmr.get "rabbit"
         | 
| 109 109 | 
             
                end
         | 
| 110 110 | 
             
              end
         | 
| 111 | 
            -
            end
         | 
| 111 | 
            +
            end unless ENV['CI']
         | 
| @@ -6,55 +6,55 @@ describe "Redis::Store::Factory" do | |
| 6 6 | 
             
                describe "when not given any arguments" do
         | 
| 7 7 | 
             
                  it "instantiates Redis::Store" do
         | 
| 8 8 | 
             
                    store = Redis::Store::Factory.create
         | 
| 9 | 
            -
                    store.must_be_kind_of(Redis::Store)
         | 
| 10 | 
            -
                    store.to_s.must_equal("Redis Client connected to 127.0.0.1:6379 against DB 0")
         | 
| 9 | 
            +
                    _(store).must_be_kind_of(Redis::Store)
         | 
| 10 | 
            +
                    _(store.to_s).must_equal("Redis Client connected to 127.0.0.1:6379 against DB 0")
         | 
| 11 11 | 
             
                  end
         | 
| 12 12 | 
             
                end
         | 
| 13 13 |  | 
| 14 14 | 
             
                describe "when given a Hash" do
         | 
| 15 15 | 
             
                  it "uses specified host" do
         | 
| 16 16 | 
             
                    store = Redis::Store::Factory.create :host => "localhost"
         | 
| 17 | 
            -
                    store.to_s.must_equal("Redis Client connected to localhost:6379 against DB 0")
         | 
| 17 | 
            +
                    _(store.to_s).must_equal("Redis Client connected to localhost:6379 against DB 0")
         | 
| 18 18 | 
             
                  end
         | 
| 19 19 |  | 
| 20 20 | 
             
                  it "uses specified port" do
         | 
| 21 21 | 
             
                    store = Redis::Store::Factory.create :host => "localhost", :port => 6380
         | 
| 22 | 
            -
                    store.to_s.must_equal("Redis Client connected to localhost:6380 against DB 0")
         | 
| 22 | 
            +
                    _(store.to_s).must_equal("Redis Client connected to localhost:6380 against DB 0")
         | 
| 23 23 | 
             
                  end
         | 
| 24 24 |  | 
| 25 25 | 
             
                  it "uses specified scheme" do
         | 
| 26 26 | 
             
                    store = Redis::Store::Factory.create :scheme => "rediss"
         | 
| 27 | 
            -
                    store.instance_variable_get(:@client).scheme.must_equal('rediss')
         | 
| 27 | 
            +
                    _(store.instance_variable_get(:@client).scheme).must_equal('rediss')
         | 
| 28 28 | 
             
                  end
         | 
| 29 29 |  | 
| 30 30 | 
             
                  it "uses specified path" do
         | 
| 31 31 | 
             
                    store = Redis::Store::Factory.create :path => "/var/run/redis.sock"
         | 
| 32 | 
            -
                    store.to_s.must_equal("Redis Client connected to /var/run/redis.sock against DB 0")
         | 
| 32 | 
            +
                    _(store.to_s).must_equal("Redis Client connected to /var/run/redis.sock against DB 0")
         | 
| 33 33 | 
             
                  end
         | 
| 34 34 |  | 
| 35 35 | 
             
                  it "uses specified db" do
         | 
| 36 36 | 
             
                    store = Redis::Store::Factory.create :host => "localhost", :port => 6380, :db => 13
         | 
| 37 | 
            -
                    store.to_s.must_equal("Redis Client connected to localhost:6380 against DB 13")
         | 
| 37 | 
            +
                    _(store.to_s).must_equal("Redis Client connected to localhost:6380 against DB 13")
         | 
| 38 38 | 
             
                  end
         | 
| 39 39 |  | 
| 40 40 | 
             
                  it "uses specified namespace" do
         | 
| 41 41 | 
             
                    store = Redis::Store::Factory.create :namespace => "theplaylist"
         | 
| 42 | 
            -
                    store.to_s.must_equal("Redis Client connected to 127.0.0.1:6379 against DB 0 with namespace theplaylist")
         | 
| 42 | 
            +
                    _(store.to_s).must_equal("Redis Client connected to 127.0.0.1:6379 against DB 0 with namespace theplaylist")
         | 
| 43 43 | 
             
                  end
         | 
| 44 44 |  | 
| 45 45 | 
             
                  it "uses specified key_prefix as namespace" do
         | 
| 46 46 | 
             
                    store = Redis::Store::Factory.create :key_prefix => "theplaylist"
         | 
| 47 | 
            -
                    store.to_s.must_equal("Redis Client connected to 127.0.0.1:6379 against DB 0 with namespace theplaylist")
         | 
| 47 | 
            +
                    _(store.to_s).must_equal("Redis Client connected to 127.0.0.1:6379 against DB 0 with namespace theplaylist")
         | 
| 48 48 | 
             
                  end
         | 
| 49 49 |  | 
| 50 50 | 
             
                  it "uses specified password" do
         | 
| 51 51 | 
             
                    store = Redis::Store::Factory.create :password => "secret"
         | 
| 52 | 
            -
                    store.instance_variable_get(:@client).password.must_equal("secret")
         | 
| 52 | 
            +
                    _(store.instance_variable_get(:@client).password).must_equal("secret")
         | 
| 53 53 | 
             
                  end
         | 
| 54 54 |  | 
| 55 55 | 
             
                  it 'uses empty password' do
         | 
| 56 56 | 
             
                    store = Redis::Store::Factory.create :password => ''
         | 
| 57 | 
            -
                    store.instance_variable_get(:@client).password.must_equal('')
         | 
| 57 | 
            +
                    _(store.instance_variable_get(:@client).password).must_equal('')
         | 
| 58 58 | 
             
                  end
         | 
| 59 59 |  | 
| 60 60 | 
             
                  it 'uses nil password' do
         | 
| @@ -64,30 +64,30 @@ describe "Redis::Store::Factory" do | |
| 64 64 |  | 
| 65 65 | 
             
                  it "disables serialization" do
         | 
| 66 66 | 
             
                    store = Redis::Store::Factory.create :serializer => nil
         | 
| 67 | 
            -
                    store.instance_variable_get(:@serializer).must_be_nil
         | 
| 68 | 
            -
                    store.instance_variable_get(:@options)[:raw].must_equal(true)
         | 
| 67 | 
            +
                    _(store.instance_variable_get(:@serializer)).must_be_nil
         | 
| 68 | 
            +
                    _(store.instance_variable_get(:@options)[:raw]).must_equal(true)
         | 
| 69 69 | 
             
                  end
         | 
| 70 70 |  | 
| 71 71 | 
             
                  it "configures pluggable serialization backend" do
         | 
| 72 72 | 
             
                    store = Redis::Store::Factory.create :serializer => JSON
         | 
| 73 | 
            -
                    store.instance_variable_get(:@serializer).must_equal(JSON)
         | 
| 74 | 
            -
                    store.instance_variable_get(:@options)[:raw].must_equal(false)
         | 
| 73 | 
            +
                    _(store.instance_variable_get(:@serializer)).must_equal(JSON)
         | 
| 74 | 
            +
                    _(store.instance_variable_get(:@options)[:raw]).must_equal(false)
         | 
| 75 75 | 
             
                  end
         | 
| 76 76 |  | 
| 77 77 | 
             
                  describe "defaults" do
         | 
| 78 78 | 
             
                    it "defaults to localhost if no host specified" do
         | 
| 79 79 | 
             
                      store = Redis::Store::Factory.create
         | 
| 80 | 
            -
                      store.instance_variable_get(:@client).host.must_equal('127.0.0.1')
         | 
| 80 | 
            +
                      _(store.instance_variable_get(:@client).host).must_equal('127.0.0.1')
         | 
| 81 81 | 
             
                    end
         | 
| 82 82 |  | 
| 83 83 | 
             
                    it "defaults to 6379 if no port specified" do
         | 
| 84 84 | 
             
                      store = Redis::Store::Factory.create
         | 
| 85 | 
            -
                      store.instance_variable_get(:@client).port.must_equal(6379)
         | 
| 85 | 
            +
                      _(store.instance_variable_get(:@client).port).must_equal(6379)
         | 
| 86 86 | 
             
                    end
         | 
| 87 87 |  | 
| 88 88 | 
             
                    it "defaults to redis:// if no scheme specified" do
         | 
| 89 89 | 
             
                      store = Redis::Store::Factory.create
         | 
| 90 | 
            -
                      store.instance_variable_get(:@client).scheme.must_equal('redis')
         | 
| 90 | 
            +
                      _(store.instance_variable_get(:@client).scheme).must_equal('redis')
         | 
| 91 91 | 
             
                    end
         | 
| 92 92 | 
             
                  end
         | 
| 93 93 |  | 
| @@ -102,14 +102,14 @@ describe "Redis::Store::Factory" do | |
| 102 102 |  | 
| 103 103 | 
             
                    it "disables marshalling and provides deprecation warning" do
         | 
| 104 104 | 
             
                      store = Redis::Store::Factory.create :marshalling => false
         | 
| 105 | 
            -
                      store.instance_variable_get(:@serializer).must_be_nil
         | 
| 106 | 
            -
                      store.instance_variable_get(:@options)[:raw].must_equal(true)
         | 
| 105 | 
            +
                      _(store.instance_variable_get(:@serializer)).must_be_nil
         | 
| 106 | 
            +
                      _(store.instance_variable_get(:@options)[:raw]).must_equal(true)
         | 
| 107 107 | 
             
                    end
         | 
| 108 108 |  | 
| 109 109 | 
             
                    it "enables marshalling but provides warning to use :serializer instead" do
         | 
| 110 110 | 
             
                      store = Redis::Store::Factory.create :marshalling => true
         | 
| 111 | 
            -
                      store.instance_variable_get(:@serializer).must_equal(Marshal)
         | 
| 112 | 
            -
                      store.instance_variable_get(:@options)[:raw].must_equal(false)
         | 
| 111 | 
            +
                      _(store.instance_variable_get(:@serializer)).must_equal(Marshal)
         | 
| 112 | 
            +
                      _(store.instance_variable_get(:@options)[:raw]).must_equal(false)
         | 
| 113 113 | 
             
                    end
         | 
| 114 114 |  | 
| 115 115 | 
             
                    after do
         | 
| @@ -123,8 +123,8 @@ describe "Redis::Store::Factory" do | |
| 123 123 | 
             
                      { :host => "localhost", :port => 6379 },
         | 
| 124 124 | 
             
                      { :host => "localhost", :port => 6380 }
         | 
| 125 125 | 
             
                    )
         | 
| 126 | 
            -
                    store.must_be_kind_of(Redis::DistributedStore)
         | 
| 127 | 
            -
                    store.nodes.map { |node| node.to_s }.must_equal([
         | 
| 126 | 
            +
                    _(store).must_be_kind_of(Redis::DistributedStore)
         | 
| 127 | 
            +
                    _(store.nodes.map { |node| node.to_s }).must_equal([
         | 
| 128 128 | 
             
                      "Redis Client connected to localhost:6379 against DB 0",
         | 
| 129 129 | 
             
                      "Redis Client connected to localhost:6380 against DB 0",
         | 
| 130 130 | 
             
                    ])
         | 
| @@ -134,62 +134,62 @@ describe "Redis::Store::Factory" do | |
| 134 134 | 
             
                describe "when given a String" do
         | 
| 135 135 | 
             
                  it "uses specified host" do
         | 
| 136 136 | 
             
                    store = Redis::Store::Factory.create "redis://127.0.0.1"
         | 
| 137 | 
            -
                    store.to_s.must_equal("Redis Client connected to 127.0.0.1:6379 against DB 0")
         | 
| 137 | 
            +
                    _(store.to_s).must_equal("Redis Client connected to 127.0.0.1:6379 against DB 0")
         | 
| 138 138 | 
             
                  end
         | 
| 139 139 |  | 
| 140 140 | 
             
                  it "uses specified port" do
         | 
| 141 141 | 
             
                    store = Redis::Store::Factory.create "redis://127.0.0.1:6380"
         | 
| 142 | 
            -
                    store.to_s.must_equal("Redis Client connected to 127.0.0.1:6380 against DB 0")
         | 
| 142 | 
            +
                    _(store.to_s).must_equal("Redis Client connected to 127.0.0.1:6380 against DB 0")
         | 
| 143 143 | 
             
                  end
         | 
| 144 144 |  | 
| 145 145 | 
             
                  it "uses specified scheme" do
         | 
| 146 146 | 
             
                    store = Redis::Store::Factory.create "rediss://127.0.0.1:6380"
         | 
| 147 | 
            -
                    store.instance_variable_get(:@client).scheme.must_equal('rediss')
         | 
| 147 | 
            +
                    _(store.instance_variable_get(:@client).scheme).must_equal('rediss')
         | 
| 148 148 | 
             
                  end
         | 
| 149 149 |  | 
| 150 150 | 
             
                  it "correctly defaults to redis:// when relative scheme specified" do
         | 
| 151 151 | 
             
                    store = Redis::Store::Factory.create "//127.0.0.1:6379"
         | 
| 152 | 
            -
                    store.instance_variable_get(:@client).scheme.must_equal('redis')
         | 
| 152 | 
            +
                    _(store.instance_variable_get(:@client).scheme).must_equal('redis')
         | 
| 153 153 | 
             
                  end
         | 
| 154 154 |  | 
| 155 155 | 
             
                  it "uses specified path" do
         | 
| 156 156 | 
             
                    store = Redis::Store::Factory.create "unix:///var/run/redis.sock"
         | 
| 157 | 
            -
                    store.to_s.must_equal("Redis Client connected to /var/run/redis.sock against DB 0")
         | 
| 157 | 
            +
                    _(store.to_s).must_equal("Redis Client connected to /var/run/redis.sock against DB 0")
         | 
| 158 158 | 
             
                  end
         | 
| 159 159 |  | 
| 160 160 | 
             
                  it "uses specified db" do
         | 
| 161 161 | 
             
                    store = Redis::Store::Factory.create "redis://127.0.0.1:6380/13"
         | 
| 162 | 
            -
                    store.to_s.must_equal("Redis Client connected to 127.0.0.1:6380 against DB 13")
         | 
| 162 | 
            +
                    _(store.to_s).must_equal("Redis Client connected to 127.0.0.1:6380 against DB 13")
         | 
| 163 163 | 
             
                  end
         | 
| 164 164 |  | 
| 165 165 | 
             
                  it "uses specified namespace" do
         | 
| 166 166 | 
             
                    store = Redis::Store::Factory.create "redis://127.0.0.1:6379/0/theplaylist"
         | 
| 167 | 
            -
                    store.to_s.must_equal("Redis Client connected to 127.0.0.1:6379 against DB 0 with namespace theplaylist")
         | 
| 167 | 
            +
                    _(store.to_s).must_equal("Redis Client connected to 127.0.0.1:6379 against DB 0 with namespace theplaylist")
         | 
| 168 168 | 
             
                  end
         | 
| 169 169 |  | 
| 170 170 | 
             
                  it "uses specified via query namespace" do
         | 
| 171 171 | 
             
                    store = Redis::Store::Factory.create "redis://127.0.0.1:6379/0?namespace=theplaylist"
         | 
| 172 | 
            -
                    store.to_s.must_equal("Redis Client connected to 127.0.0.1:6379 against DB 0 with namespace theplaylist")
         | 
| 172 | 
            +
                    _(store.to_s).must_equal("Redis Client connected to 127.0.0.1:6379 against DB 0 with namespace theplaylist")
         | 
| 173 173 | 
             
                  end
         | 
| 174 174 |  | 
| 175 175 | 
             
                  it "uses specified namespace with path" do
         | 
| 176 176 | 
             
                    store = Redis::Store::Factory.create "unix:///var/run/redis.sock?db=2&namespace=theplaylist"
         | 
| 177 | 
            -
                    store.to_s.must_equal("Redis Client connected to /var/run/redis.sock against DB 2 with namespace theplaylist")
         | 
| 177 | 
            +
                    _(store.to_s).must_equal("Redis Client connected to /var/run/redis.sock against DB 2 with namespace theplaylist")
         | 
| 178 178 | 
             
                  end
         | 
| 179 179 |  | 
| 180 180 | 
             
                  it "uses specified password" do
         | 
| 181 181 | 
             
                    store = Redis::Store::Factory.create "redis://:secret@127.0.0.1:6379/0/theplaylist"
         | 
| 182 | 
            -
                    store.instance_variable_get(:@client).password.must_equal("secret")
         | 
| 182 | 
            +
                    _(store.instance_variable_get(:@client).password).must_equal("secret")
         | 
| 183 183 | 
             
                  end
         | 
| 184 184 |  | 
| 185 185 | 
             
                  it 'uses specified password with special characters' do
         | 
| 186 186 | 
             
                    store = Redis::Store::Factory.create 'redis://:pwd%40123@127.0.0.1:6379/0/theplaylist'
         | 
| 187 | 
            -
                    store.instance_variable_get(:@client).password.must_equal('pwd@123')
         | 
| 187 | 
            +
                    _(store.instance_variable_get(:@client).password).must_equal('pwd@123')
         | 
| 188 188 | 
             
                  end
         | 
| 189 189 |  | 
| 190 190 | 
             
                  it 'uses empty password' do
         | 
| 191 191 | 
             
                    store = Redis::Store::Factory.create 'redis://:@127.0.0.1:6379/0/theplaylist'
         | 
| 192 | 
            -
                    store.instance_variable_get(:@client).password.must_equal('')
         | 
| 192 | 
            +
                    _(store.instance_variable_get(:@client).password).must_equal('')
         | 
| 193 193 | 
             
                  end
         | 
| 194 194 |  | 
| 195 195 | 
             
                  it 'uses nil password' do
         | 
| @@ -199,14 +199,14 @@ describe "Redis::Store::Factory" do | |
| 199 199 |  | 
| 200 200 | 
             
                  it "correctly uses specified ipv6 host" do
         | 
| 201 201 | 
             
                    store = Redis::Store::Factory.create "redis://[::1]:6380"
         | 
| 202 | 
            -
                    store.to_s.must_equal("Redis Client connected to [::1]:6380 against DB 0")
         | 
| 203 | 
            -
                    store.instance_variable_get('@options')[:host].must_equal("::1")
         | 
| 202 | 
            +
                    _(store.to_s).must_equal("Redis Client connected to [::1]:6380 against DB 0")
         | 
| 203 | 
            +
                    _(store.instance_variable_get('@options')[:host]).must_equal("::1")
         | 
| 204 204 | 
             
                  end
         | 
| 205 205 |  | 
| 206 206 | 
             
                  it "instantiates Redis::DistributedStore" do
         | 
| 207 207 | 
             
                    store = Redis::Store::Factory.create "redis://127.0.0.1:6379", "redis://127.0.0.1:6380"
         | 
| 208 | 
            -
                    store.must_be_kind_of(Redis::DistributedStore)
         | 
| 209 | 
            -
                    store.nodes.map { |node| node.to_s }.must_equal([
         | 
| 208 | 
            +
                    _(store).must_be_kind_of(Redis::DistributedStore)
         | 
| 209 | 
            +
                    _(store.nodes.map { |node| node.to_s }).must_equal([
         | 
| 210 210 | 
             
                      "Redis Client connected to 127.0.0.1:6379 against DB 0",
         | 
| 211 211 | 
             
                      "Redis Client connected to 127.0.0.1:6380 against DB 0",
         | 
| 212 212 | 
             
                    ])
         | 
| @@ -227,7 +227,7 @@ describe "Redis::Store::Factory" do | |
| 227 227 | 
             
                      { :host => '127.0.0.1', :port => '6380' },
         | 
| 228 228 | 
             
                      { :namespace => 'theplaylist' }
         | 
| 229 229 | 
             
                    )
         | 
| 230 | 
            -
                    store.nodes.map { |node| node.to_s }.must_equal([
         | 
| 230 | 
            +
                    _(store.nodes.map { |node| node.to_s }).must_equal([
         | 
| 231 231 | 
             
                      "Redis Client connected to 127.0.0.1:6379 against DB 0 with namespace theplaylist",
         | 
| 232 232 | 
             
                      "Redis Client connected to 127.0.0.1:6380 against DB 0 with namespace theplaylist"
         | 
| 233 233 | 
             
                    ])
         | 
| @@ -237,12 +237,12 @@ describe "Redis::Store::Factory" do | |
| 237 237 | 
             
                describe 'when given host String and options Hash' do
         | 
| 238 238 | 
             
                  it 'instantiates Redis::Store and merges options' do
         | 
| 239 239 | 
             
                    store = Redis::Store::Factory.create "redis://127.0.0.1", :namespace => 'theplaylist'
         | 
| 240 | 
            -
                    store.to_s.must_equal("Redis Client connected to 127.0.0.1:6379 against DB 0 with namespace theplaylist")
         | 
| 240 | 
            +
                    _(store.to_s).must_equal("Redis Client connected to 127.0.0.1:6379 against DB 0 with namespace theplaylist")
         | 
| 241 241 | 
             
                  end
         | 
| 242 242 |  | 
| 243 243 | 
             
                  it 'instantiates Redis::DistributedStore and merges options' do
         | 
| 244 244 | 
             
                    store = Redis::Store::Factory.create "redis://127.0.0.1:6379", "redis://127.0.0.1:6380", :namespace => 'theplaylist'
         | 
| 245 | 
            -
                    store.nodes.map { |node| node.to_s }.must_equal([
         | 
| 245 | 
            +
                    _(store.nodes.map { |node| node.to_s }).must_equal([
         | 
| 246 246 | 
             
                      "Redis Client connected to 127.0.0.1:6379 against DB 0 with namespace theplaylist",
         | 
| 247 247 | 
             
                      "Redis Client connected to 127.0.0.1:6380 against DB 0 with namespace theplaylist",
         | 
| 248 248 | 
             
                    ])
         | 
| @@ -250,7 +250,7 @@ describe "Redis::Store::Factory" do | |
| 250 250 |  | 
| 251 251 | 
             
                  it 'instantiates Redis::Store and sets namespace from String' do
         | 
| 252 252 | 
             
                    store = Redis::Store::Factory.create "redis://127.0.0.1:6379/0/theplaylist", :expire_after => 5
         | 
| 253 | 
            -
                    store.to_s.must_equal("Redis Client connected to 127.0.0.1:6379 against DB 0 with namespace theplaylist")
         | 
| 253 | 
            +
                    _(store.to_s).must_equal("Redis Client connected to 127.0.0.1:6379 against DB 0 with namespace theplaylist")
         | 
| 254 254 | 
             
                  end
         | 
| 255 255 | 
             
                end
         | 
| 256 256 | 
             
              end
         | 
| @@ -3,7 +3,7 @@ require 'test_helper' | |
| 3 3 | 
             
            describe "Redis::Store::Namespace" do
         | 
| 4 4 | 
             
              def setup
         | 
| 5 5 | 
             
                @namespace = "theplaylist"
         | 
| 6 | 
            -
                @store | 
| 6 | 
            +
                @store = Redis::Store.new :namespace => @namespace, :serializer => nil
         | 
| 7 7 | 
             
                @client = @store.instance_variable_get(:@client)
         | 
| 8 8 | 
             
                @rabbit = "bunny"
         | 
| 9 9 | 
             
                @default_store = Redis::Store.new
         | 
| @@ -30,7 +30,7 @@ describe "Redis::Store::Namespace" do | |
| 30 30 | 
             
              end
         | 
| 31 31 |  | 
| 32 32 | 
             
              it "doesn't namespace a key which is already namespaced" do
         | 
| 33 | 
            -
                @store.send(:interpolate, "#{@namespace}:rabbit").must_equal("#{@namespace}:rabbit")
         | 
| 33 | 
            +
                _(@store.send(:interpolate, "#{@namespace}:rabbit")).must_equal("#{@namespace}:rabbit")
         | 
| 34 34 | 
             
              end
         | 
| 35 35 |  | 
| 36 36 | 
             
              it "should only delete namespaced keys" do
         | 
| @@ -38,26 +38,26 @@ describe "Redis::Store::Namespace" do | |
| 38 38 | 
             
                @store.set 'def', 'fed'
         | 
| 39 39 |  | 
| 40 40 | 
             
                @store.flushdb
         | 
| 41 | 
            -
                @store.get('def').must_be_nil
         | 
| 42 | 
            -
                @default_store.get('abc').must_equal('cba')
         | 
| 41 | 
            +
                _(@store.get('def')).must_be_nil
         | 
| 42 | 
            +
                _(@default_store.get('abc')).must_equal('cba')
         | 
| 43 43 | 
             
              end
         | 
| 44 44 |  | 
| 45 45 | 
             
              it 'should allow to change namespace on the fly' do
         | 
| 46 46 | 
             
                @default_store.set 'abc', 'cba'
         | 
| 47 47 | 
             
                @other_store.set 'foo', 'bar'
         | 
| 48 48 |  | 
| 49 | 
            -
                @default_store.keys.sort.must_equal ['abc', 'other:foo']
         | 
| 49 | 
            +
                _(@default_store.keys.sort).must_equal ['abc', 'other:foo']
         | 
| 50 50 |  | 
| 51 51 | 
             
                @default_store.with_namespace(@other_namespace) do
         | 
| 52 | 
            -
                  @default_store.keys.must_equal ['foo']
         | 
| 53 | 
            -
                  @default_store.get('foo').must_equal('bar')
         | 
| 52 | 
            +
                  _(@default_store.keys).must_equal ['foo']
         | 
| 53 | 
            +
                  _(@default_store.get('foo')).must_equal('bar')
         | 
| 54 54 | 
             
                end
         | 
| 55 55 | 
             
              end
         | 
| 56 56 |  | 
| 57 57 | 
             
              it "should not try to delete missing namespaced keys" do
         | 
| 58 58 | 
             
                empty_store = Redis::Store.new :namespace => 'empty'
         | 
| 59 59 | 
             
                empty_store.flushdb
         | 
| 60 | 
            -
                empty_store.keys.must_be_empty
         | 
| 60 | 
            +
                _(empty_store.keys).must_be_empty
         | 
| 61 61 | 
             
              end
         | 
| 62 62 |  | 
| 63 63 | 
             
              it "should work with dynamic namespace" do
         | 
| @@ -74,7 +74,7 @@ describe "Redis::Store::Namespace" do | |
| 74 74 | 
             
                r2 = dyn_store.get 'key'
         | 
| 75 75 | 
             
                $ns = "ns1"
         | 
| 76 76 | 
             
                r1 = dyn_store.get 'key'
         | 
| 77 | 
            -
                r1.must_equal('x') && r2.must_equal('y') && r3.must_be_nil
         | 
| 77 | 
            +
                _(r1).must_equal('x') && _(r2).must_equal('y') && _(r3).must_be_nil
         | 
| 78 78 | 
             
              end
         | 
| 79 79 |  | 
| 80 80 | 
             
              it "namespaces setex and ttl" do
         | 
| @@ -82,11 +82,11 @@ describe "Redis::Store::Namespace" do | |
| 82 82 | 
             
                @other_store.flushdb
         | 
| 83 83 |  | 
| 84 84 | 
             
                @store.setex('foo', 30, 'bar')
         | 
| 85 | 
            -
                @store.ttl('foo').must_be_close_to(30)
         | 
| 86 | 
            -
                @store.get('foo').must_equal('bar')
         | 
| 85 | 
            +
                _(@store.ttl('foo')).must_be_close_to(30)
         | 
| 86 | 
            +
                _(@store.get('foo')).must_equal('bar')
         | 
| 87 87 |  | 
| 88 | 
            -
                @other_store.ttl('foo').must_equal(-2)
         | 
| 89 | 
            -
                @other_store.get('foo').must_be_nil
         | 
| 88 | 
            +
                _(@other_store.ttl('foo')).must_equal(-2)
         | 
| 89 | 
            +
                _(@other_store.get('foo')).must_be_nil
         | 
| 90 90 | 
             
              end
         | 
| 91 91 |  | 
| 92 92 | 
             
              describe 'method calls' do
         | 
| @@ -120,7 +120,7 @@ describe "Redis::Store::Namespace" do | |
| 120 120 |  | 
| 121 121 | 
             
                it "should namespace keys" do
         | 
| 122 122 | 
             
                  store.set "rabbit", @rabbit
         | 
| 123 | 
            -
                  store.keys("rabb*").must_equal [ "rabbit" ]
         | 
| 123 | 
            +
                  _(store.keys("rabb*")).must_equal [ "rabbit" ]
         | 
| 124 124 | 
             
                end
         | 
| 125 125 |  | 
| 126 126 | 
             
                it "should namespace scan when a pattern is given" do
         | 
| @@ -131,7 +131,7 @@ describe "Redis::Store::Namespace" do | |
| 131 131 | 
             
                    cursor, matched_keys = store.scan(cursor, match: "rabb*")
         | 
| 132 132 | 
             
                    keys = keys.concat(matched_keys) unless matched_keys.empty?
         | 
| 133 133 | 
             
                  end until cursor == "0"
         | 
| 134 | 
            -
                  keys.must_equal [ "rabbit" ]
         | 
| 134 | 
            +
                  _(keys).must_equal [ "rabbit" ]
         | 
| 135 135 | 
             
                end
         | 
| 136 136 |  | 
| 137 137 | 
             
                it "should namespace exists" do
         | 
| @@ -152,16 +152,16 @@ describe "Redis::Store::Namespace" do | |
| 152 152 | 
             
                it "should namespace mget" do
         | 
| 153 153 | 
             
                  client.expects(:call).with([:mget, "#{@namespace}:rabbit", "#{@namespace}:white_rabbit"]).returns(%w[ foo bar ])
         | 
| 154 154 | 
             
                  store.mget "rabbit", "white_rabbit" do |result|
         | 
| 155 | 
            -
                    result.must_equal(%w[ foo bar ])
         | 
| 155 | 
            +
                    _(result).must_equal(%w[ foo bar ])
         | 
| 156 156 | 
             
                  end
         | 
| 157 157 | 
             
                end
         | 
| 158 158 |  | 
| 159 159 | 
             
                it "should namespace mapped_mget" do
         | 
| 160 160 | 
             
                  client.expects(:process).with([[:mget, "#{@namespace}:rabbit", "#{@namespace}:white_rabbit"]]).returns(%w[ foo bar ])
         | 
| 161 161 | 
             
                  result = store.mapped_mget "rabbit", "white_rabbit"
         | 
| 162 | 
            -
                  result.keys.must_equal %w[ rabbit white_rabbit ]
         | 
| 163 | 
            -
                  result["rabbit"].must_equal "foo"
         | 
| 164 | 
            -
                  result["white_rabbit"].must_equal "bar"
         | 
| 162 | 
            +
                  _(result.keys).must_equal %w[ rabbit white_rabbit ]
         | 
| 163 | 
            +
                  _(result["rabbit"]).must_equal "foo"
         | 
| 164 | 
            +
                  _(result["white_rabbit"]).must_equal "bar"
         | 
| 165 165 | 
             
                end
         | 
| 166 166 |  | 
| 167 167 | 
             
                it "should namespace expire" do
         | 
| @@ -271,14 +271,14 @@ describe "Redis::Store::Namespace" do | |
| 271 271 | 
             
                  store.hscan_each("rabbit") do |key|
         | 
| 272 272 | 
             
                    results << key
         | 
| 273 273 | 
             
                  end
         | 
| 274 | 
            -
                  results.must_equal(["key1"])
         | 
| 274 | 
            +
                  _(results).must_equal(["key1"])
         | 
| 275 275 | 
             
                end
         | 
| 276 276 |  | 
| 277 277 | 
             
                it "should namespace hscan_each without block" do
         | 
| 278 278 | 
             
                  client.call([:hset, "#{@namespace}:rabbit", "key1", @rabbit])
         | 
| 279 279 | 
             
                  client.expects(:call).with([:hscan, "#{@namespace}:rabbit", 0]).returns(["0", ["key1"]])
         | 
| 280 280 | 
             
                  results = store.hscan_each("rabbit").to_a
         | 
| 281 | 
            -
                  results.must_equal(["key1"])
         | 
| 281 | 
            +
                  _(results).must_equal(["key1"])
         | 
| 282 282 | 
             
                end
         | 
| 283 283 |  | 
| 284 284 | 
             
                it "should namespace zincrby" do
         | 
| @@ -11,18 +11,18 @@ describe "Redis::RedisVersion" do | |
| 11 11 |  | 
| 12 12 | 
             
              describe '#redis_version' do
         | 
| 13 13 | 
             
                it 'returns redis version' do
         | 
| 14 | 
            -
                  @store.redis_version.to_s.must_match(/^\d{1}\.\d{1,}\.\d{1,}$/)
         | 
| 14 | 
            +
                  _(@store.redis_version.to_s).must_match(/^\d{1}\.\d{1,}\.\d{1,}$/)
         | 
| 15 15 | 
             
                end
         | 
| 16 16 | 
             
              end
         | 
| 17 17 |  | 
| 18 18 | 
             
              describe '#supports_redis_version?' do
         | 
| 19 19 | 
             
                it 'returns true if redis version is greater or equal to required version' do
         | 
| 20 20 | 
             
                  @store.stubs(:redis_version).returns('2.8.19')
         | 
| 21 | 
            -
                  @store.supports_redis_version?('2.6.0').must_equal(true)
         | 
| 22 | 
            -
                  @store.supports_redis_version?('2.8.19').must_equal(true)
         | 
| 23 | 
            -
                  @store.supports_redis_version?('2.8.20').must_equal(false)
         | 
| 24 | 
            -
                  @store.supports_redis_version?('2.9.0').must_equal(false)
         | 
| 25 | 
            -
                  @store.supports_redis_version?('3.0.0').must_equal(false)
         | 
| 21 | 
            +
                  _(@store.supports_redis_version?('2.6.0')).must_equal(true)
         | 
| 22 | 
            +
                  _(@store.supports_redis_version?('2.8.19')).must_equal(true)
         | 
| 23 | 
            +
                  _(@store.supports_redis_version?('2.8.20')).must_equal(false)
         | 
| 24 | 
            +
                  _(@store.supports_redis_version?('2.9.0')).must_equal(false)
         | 
| 25 | 
            +
                  _(@store.supports_redis_version?('3.0.0')).must_equal(false)
         | 
| 26 26 | 
             
                end
         | 
| 27 27 | 
             
              end
         | 
| 28 28 | 
             
            end
         | 
| @@ -15,120 +15,122 @@ describe "Redis::Serialization" do | |
| 15 15 | 
             
              end
         | 
| 16 16 |  | 
| 17 17 | 
             
              it "unmarshals on get" do
         | 
| 18 | 
            -
                @store.get("rabbit").must_equal(@rabbit)
         | 
| 18 | 
            +
                _(@store.get("rabbit")).must_equal(@rabbit)
         | 
| 19 19 | 
             
              end
         | 
| 20 20 |  | 
| 21 21 | 
             
              it "marshals on set" do
         | 
| 22 22 | 
             
                @store.set "rabbit", @white_rabbit
         | 
| 23 | 
            -
                @store.get("rabbit").must_equal(@white_rabbit)
         | 
| 23 | 
            +
                _(@store.get("rabbit")).must_equal(@white_rabbit)
         | 
| 24 24 | 
             
              end
         | 
| 25 25 |  | 
| 26 26 | 
             
              it "marshals on multi set" do
         | 
| 27 27 | 
             
                @store.mset("rabbit", @white_rabbit, "rabbit2", @rabbit)
         | 
| 28 | 
            -
                @store.get("rabbit").must_equal(@white_rabbit)
         | 
| 29 | 
            -
                @store.get("rabbit2").must_equal(@rabbit)
         | 
| 28 | 
            +
                _(@store.get("rabbit")).must_equal(@white_rabbit)
         | 
| 29 | 
            +
                _(@store.get("rabbit2")).must_equal(@rabbit)
         | 
| 30 30 | 
             
              end
         | 
| 31 31 |  | 
| 32 32 | 
             
              if RUBY_VERSION.match /1\.9/
         | 
| 33 33 | 
             
                it "doesn't unmarshal on get if raw option is true" do
         | 
| 34 | 
            -
                  @store.get("rabbit", :raw => true).must_equal("\x04\bU:\x0FOpenStruct{\x06:\tnameI\"\nbunny\x06:\x06EF")
         | 
| 34 | 
            +
                  _(@store.get("rabbit", :raw => true)).must_equal("\x04\bU:\x0FOpenStruct{\x06:\tnameI\"\nbunny\x06:\x06EF")
         | 
| 35 35 | 
             
                end
         | 
| 36 36 | 
             
              else
         | 
| 37 37 | 
             
                it "doesn't unmarshal on get if raw option is true" do
         | 
| 38 | 
            -
                  @store.get("rabbit", :raw => true).must_include("\x04\bU:\x0FOpenStruct{\x06:\tname")
         | 
| 38 | 
            +
                  _(@store.get("rabbit", :raw => true)).must_include("\x04\bU:\x0FOpenStruct{\x06:\tname")
         | 
| 39 39 | 
             
                end
         | 
| 40 40 | 
             
              end
         | 
| 41 41 |  | 
| 42 42 | 
             
              it "doesn't marshal set if raw option is true" do
         | 
| 43 43 | 
             
                @store.set "rabbit", @white_rabbit, :raw => true
         | 
| 44 | 
            -
                @store.get("rabbit", :raw => true).must_equal(%(#<OpenStruct color="white">))
         | 
| 44 | 
            +
                _(@store.get("rabbit", :raw => true)).must_equal(%(#<OpenStruct color="white">))
         | 
| 45 45 | 
             
              end
         | 
| 46 46 |  | 
| 47 47 | 
             
              it "doesn't marshal multi set if raw option is true" do
         | 
| 48 48 | 
             
                @store.mset("rabbit", @white_rabbit, "rabbit2", @rabbit, :raw => true)
         | 
| 49 | 
            -
                @store.get("rabbit", :raw => true).must_equal(%(#<OpenStruct color="white">))
         | 
| 50 | 
            -
                @store.get("rabbit2", :raw => true).must_equal(%(#<OpenStruct name="bunny">))
         | 
| 49 | 
            +
                _(@store.get("rabbit", :raw => true)).must_equal(%(#<OpenStruct color="white">))
         | 
| 50 | 
            +
                _(@store.get("rabbit2", :raw => true)).must_equal(%(#<OpenStruct name="bunny">))
         | 
| 51 51 | 
             
              end
         | 
| 52 52 |  | 
| 53 53 | 
             
              it "doesn't unmarshal if get returns an empty string" do
         | 
| 54 54 | 
             
                @store.set "empty_string", ""
         | 
| 55 | 
            -
                @store.get("empty_string").must_equal("")
         | 
| 55 | 
            +
                _(@store.get("empty_string")).must_equal("")
         | 
| 56 56 | 
             
                # TODO use a meaningful Exception
         | 
| 57 57 | 
             
                # lambda { @store.get("empty_string").must_equal("") }.wont_raise Exception
         | 
| 58 58 | 
             
              end
         | 
| 59 59 |  | 
| 60 60 | 
             
              it "doesn't set an object if already exist" do
         | 
| 61 61 | 
             
                @store.setnx "rabbit", @white_rabbit
         | 
| 62 | 
            -
                @store.get("rabbit").must_equal(@rabbit)
         | 
| 62 | 
            +
                _(@store.get("rabbit")).must_equal(@rabbit)
         | 
| 63 63 | 
             
              end
         | 
| 64 64 |  | 
| 65 65 | 
             
              it "marshals on set unless exists" do
         | 
| 66 66 | 
             
                @store.setnx "rabbit2", @white_rabbit
         | 
| 67 | 
            -
                @store.get("rabbit2").must_equal(@white_rabbit)
         | 
| 67 | 
            +
                _(@store.get("rabbit2")).must_equal(@white_rabbit)
         | 
| 68 68 | 
             
              end
         | 
| 69 69 |  | 
| 70 70 | 
             
              it "doesn't marshal on set unless exists if raw option is true" do
         | 
| 71 71 | 
             
                @store.setnx "rabbit2", @white_rabbit, :raw => true
         | 
| 72 | 
            -
                @store.get("rabbit2", :raw => true).must_equal(%(#<OpenStruct color="white">))
         | 
| 72 | 
            +
                _(@store.get("rabbit2", :raw => true)).must_equal(%(#<OpenStruct color="white">))
         | 
| 73 73 | 
             
              end
         | 
| 74 74 |  | 
| 75 75 | 
             
              it "marshals on set expire" do
         | 
| 76 76 | 
             
                @store.setex "rabbit2", 1, @white_rabbit
         | 
| 77 | 
            -
                @store.get("rabbit2").must_equal(@white_rabbit)
         | 
| 77 | 
            +
                _(@store.get("rabbit2")).must_equal(@white_rabbit)
         | 
| 78 78 | 
             
                sleep 2
         | 
| 79 | 
            -
                @store.get("rabbit2").must_be_nil
         | 
| 79 | 
            +
                _(@store.get("rabbit2")).must_be_nil
         | 
| 80 80 | 
             
              end
         | 
| 81 81 |  | 
| 82 | 
            -
               | 
| 83 | 
            -
                 | 
| 84 | 
            -
                   | 
| 85 | 
            -
             | 
| 86 | 
            -
             | 
| 87 | 
            -
             | 
| 88 | 
            -
             | 
| 89 | 
            -
             | 
| 82 | 
            +
              unless ENV['CI']
         | 
| 83 | 
            +
                it "marshals setex (over a distributed store)" do
         | 
| 84 | 
            +
                  @store = Redis::DistributedStore.new [
         | 
| 85 | 
            +
                    { :host => "localhost", :port => "6380", :db => 0 },
         | 
| 86 | 
            +
                    { :host => "localhost", :port => "6381", :db => 0 }
         | 
| 87 | 
            +
                  ]
         | 
| 88 | 
            +
                  @store.setex "rabbit", 50, @white_rabbit
         | 
| 89 | 
            +
                  _(@store.get("rabbit")).must_equal(@white_rabbit)
         | 
| 90 | 
            +
                end
         | 
| 90 91 |  | 
| 91 | 
            -
             | 
| 92 | 
            -
             | 
| 93 | 
            -
             | 
| 94 | 
            -
             | 
| 95 | 
            -
             | 
| 96 | 
            -
             | 
| 97 | 
            -
             | 
| 92 | 
            +
                it "doesn't marshal setex if raw option is true (over a distributed store)" do
         | 
| 93 | 
            +
                  @store = Redis::DistributedStore.new [
         | 
| 94 | 
            +
                    { :host => "localhost", :port => "6380", :db => 0 },
         | 
| 95 | 
            +
                    { :host => "localhost", :port => "6381", :db => 0 }
         | 
| 96 | 
            +
                  ]
         | 
| 97 | 
            +
                  @store.setex "rabbit", 50, @white_rabbit, :raw => true
         | 
| 98 | 
            +
                  _(@store.get("rabbit", :raw => true)).must_equal(%(#<OpenStruct color="white">))
         | 
| 99 | 
            +
                end
         | 
| 98 100 | 
             
              end
         | 
| 99 101 |  | 
| 100 102 | 
             
              it "unmarshals on multi get" do
         | 
| 101 103 | 
             
                @store.set "rabbit2", @white_rabbit
         | 
| 102 104 | 
             
                @store.mget "rabbit", "rabbit2" do |rabbits|
         | 
| 103 105 | 
             
                  rabbit, rabbit2 = rabbits
         | 
| 104 | 
            -
                  rabbits.length.must_equal(2)
         | 
| 105 | 
            -
                  rabbit.must_equal(@rabbit)
         | 
| 106 | 
            -
                  rabbit2.must_equal(@white_rabbit)
         | 
| 106 | 
            +
                  _(rabbits.length).must_equal(2)
         | 
| 107 | 
            +
                  _(rabbit).must_equal(@rabbit)
         | 
| 108 | 
            +
                  _(rabbit2).must_equal(@white_rabbit)
         | 
| 107 109 | 
             
                end
         | 
| 108 110 | 
             
              end
         | 
| 109 111 |  | 
| 110 112 | 
             
              it "unmarshals on mapped_mget" do
         | 
| 111 113 | 
             
                @store.set "rabbit2", @white_rabbit
         | 
| 112 114 | 
             
                result = @store.mapped_mget("rabbit", "rabbit2")
         | 
| 113 | 
            -
                result.keys.must_equal %w[ rabbit rabbit2 ]
         | 
| 114 | 
            -
                result["rabbit"].must_equal @rabbit
         | 
| 115 | 
            -
                result["rabbit2"].must_equal @white_rabbit
         | 
| 115 | 
            +
                _(result.keys).must_equal %w[ rabbit rabbit2 ]
         | 
| 116 | 
            +
                _(result["rabbit"]).must_equal @rabbit
         | 
| 117 | 
            +
                _(result["rabbit2"]).must_equal @white_rabbit
         | 
| 116 118 | 
             
              end
         | 
| 117 119 |  | 
| 118 120 | 
             
              if RUBY_VERSION.match /1\.9/
         | 
| 119 121 | 
             
                it "doesn't unmarshal on multi get if raw option is true" do
         | 
| 120 122 | 
             
                  @store.set "rabbit2", @white_rabbit
         | 
| 121 123 | 
             
                  @store.mget "rabbit", "rabbit2", :raw => true do |rabbit, rabbit2|
         | 
| 122 | 
            -
                    rabbit.must_equal("\x04\bU:\x0FOpenStruct{\x06:\tnameI\"\nbunny\x06:\x06EF")
         | 
| 123 | 
            -
                    rabbit2.must_equal("\x04\bU:\x0FOpenStruct{\x06:\ncolorI\"\nwhite\x06:\x06EF")
         | 
| 124 | 
            +
                    _(rabbit).must_equal("\x04\bU:\x0FOpenStruct{\x06:\tnameI\"\nbunny\x06:\x06EF")
         | 
| 125 | 
            +
                    _(rabbit2).must_equal("\x04\bU:\x0FOpenStruct{\x06:\ncolorI\"\nwhite\x06:\x06EF")
         | 
| 124 126 | 
             
                  end
         | 
| 125 127 | 
             
                end
         | 
| 126 128 | 
             
              else
         | 
| 127 129 | 
             
                it "doesn't unmarshal on multi get if raw option is true" do
         | 
| 128 130 | 
             
                  @store.set "rabbit2", @white_rabbit
         | 
| 129 131 | 
             
                  @store.mget "rabbit", "rabbit2", :raw => true do |rabbit, rabbit2|
         | 
| 130 | 
            -
                    rabbit.must_include("\x04\bU:\x0FOpenStruct{\x06:\tname")
         | 
| 131 | 
            -
                    rabbit2.must_include("\x04\bU:\x0FOpenStruct{\x06:\ncolor")
         | 
| 132 | 
            +
                    _(rabbit).must_include("\x04\bU:\x0FOpenStruct{\x06:\tname")
         | 
| 133 | 
            +
                    _(rabbit2).must_include("\x04\bU:\x0FOpenStruct{\x06:\ncolor")
         | 
| 132 134 | 
             
                  end
         | 
| 133 135 | 
             
                end
         | 
| 134 136 | 
             
              end
         | 
| @@ -139,7 +141,7 @@ describe "Redis::Serialization" do | |
| 139 141 | 
             
                  ascii_rabbit = OpenStruct.new(:name => [128].pack("C*"))
         | 
| 140 142 |  | 
| 141 143 | 
             
                  @store.set(utf8_key, ascii_rabbit)
         | 
| 142 | 
            -
                  @store.get(utf8_key).must_equal(ascii_rabbit)
         | 
| 144 | 
            +
                  _(@store.get(utf8_key)).must_equal(ascii_rabbit)
         | 
| 143 145 | 
             
                end
         | 
| 144 146 |  | 
| 145 147 | 
             
                it "gets and sets raw values" do
         | 
| @@ -147,7 +149,7 @@ describe "Redis::Serialization" do | |
| 147 149 | 
             
                  ascii_string = [128].pack("C*")
         | 
| 148 150 |  | 
| 149 151 | 
             
                  @store.set(utf8_key, ascii_string, :raw => true)
         | 
| 150 | 
            -
                  @store.get(utf8_key, :raw => true).bytes.to_a.must_equal(ascii_string.bytes.to_a)
         | 
| 152 | 
            +
                  _(@store.get(utf8_key, :raw => true).bytes.to_a).must_equal(ascii_string.bytes.to_a)
         | 
| 151 153 | 
             
                end
         | 
| 152 154 |  | 
| 153 155 | 
             
                it "marshals objects on setnx" do
         | 
| @@ -156,7 +158,7 @@ describe "Redis::Serialization" do | |
| 156 158 |  | 
| 157 159 | 
             
                  @store.del(utf8_key)
         | 
| 158 160 | 
             
                  @store.setnx(utf8_key, ascii_rabbit)
         | 
| 159 | 
            -
                  @store.get(utf8_key).must_equal(ascii_rabbit)
         | 
| 161 | 
            +
                  _(@store.get(utf8_key)).must_equal(ascii_rabbit)
         | 
| 160 162 | 
             
                end
         | 
| 161 163 |  | 
| 162 164 | 
             
                it "gets and sets raw values on setnx" do
         | 
| @@ -165,7 +167,7 @@ describe "Redis::Serialization" do | |
| 165 167 |  | 
| 166 168 | 
             
                  @store.del(utf8_key)
         | 
| 167 169 | 
             
                  @store.setnx(utf8_key, ascii_string, :raw => true)
         | 
| 168 | 
            -
                  @store.get(utf8_key, :raw => true).bytes.to_a.must_equal(ascii_string.bytes.to_a)
         | 
| 170 | 
            +
                  _(@store.get(utf8_key, :raw => true).bytes.to_a).must_equal(ascii_string.bytes.to_a)
         | 
| 169 171 | 
             
                end
         | 
| 170 172 | 
             
              end if defined?(Encoding)
         | 
| 171 173 | 
             
            end
         | 
| @@ -66,14 +66,14 @@ describe MockTtlStore do | |
| 66 66 | 
             
                describe 'without options' do
         | 
| 67 67 | 
             
                  it 'must call super with key and value' do
         | 
| 68 68 | 
             
                    redis.set(key, mock_value)
         | 
| 69 | 
            -
                    redis.has_set?(key, mock_value, nil).must_equal true
         | 
| 69 | 
            +
                    _(redis.has_set?(key, mock_value, nil)).must_equal true
         | 
| 70 70 | 
             
                  end
         | 
| 71 71 | 
             
                end
         | 
| 72 72 |  | 
| 73 73 | 
             
                describe 'with options' do
         | 
| 74 74 | 
             
                  it 'must call setex with proper expiry and set raw to true' do
         | 
| 75 75 | 
             
                    redis.set(key, mock_value, options)
         | 
| 76 | 
            -
                    redis.has_setex?(key, options[:expire_after], mock_value, :raw => true).must_equal true
         | 
| 76 | 
            +
                    _(redis.has_setex?(key, options[:expire_after], mock_value, :raw => true)).must_equal true
         | 
| 77 77 | 
             
                  end
         | 
| 78 78 | 
             
                end
         | 
| 79 79 |  | 
| @@ -81,7 +81,7 @@ describe MockTtlStore do | |
| 81 81 | 
             
                  it 'must call super with key and value and options' do
         | 
| 82 82 | 
             
                    set_options = { nx: true, ex: 3600 }
         | 
| 83 83 | 
             
                    redis.set(key, mock_value, set_options)
         | 
| 84 | 
            -
                    redis.has_set?(key, mock_value, set_options).must_equal true
         | 
| 84 | 
            +
                    _(redis.has_set?(key, mock_value, set_options)).must_equal true
         | 
| 85 85 | 
             
                  end
         | 
| 86 86 | 
             
                end
         | 
| 87 87 | 
             
              end
         | 
| @@ -105,14 +105,9 @@ describe MockTtlStore do | |
| 105 105 | 
             
                    redis.setnx(key, mock_value, options)
         | 
| 106 106 | 
             
                  end
         | 
| 107 107 |  | 
| 108 | 
            -
                  it 'must call setnx with key and value and set raw to true' do
         | 
| 109 | 
            -
                    redis.setnx(key, mock_value, options)
         | 
| 110 | 
            -
                    redis.has_setnx?(key, mock_value, :raw => true).must_equal true
         | 
| 111 | 
            -
                  end
         | 
| 112 | 
            -
             | 
| 113 108 | 
             
                  it 'must call expire' do
         | 
| 114 109 | 
             
                    redis.setnx(key, mock_value, options)
         | 
| 115 | 
            -
                    redis.has_expire?(key, options[:expire_after]).must_equal true
         | 
| 110 | 
            +
                    _(redis.has_expire?(key, options[:expire_after])).must_equal true
         | 
| 116 111 | 
             
                  end
         | 
| 117 112 |  | 
| 118 113 | 
             
                  describe 'avoiding multi commands' do
         | 
| @@ -123,14 +118,9 @@ describe MockTtlStore do | |
| 123 118 | 
             
                      redis.setnx(key, mock_value, options)
         | 
| 124 119 | 
             
                    end
         | 
| 125 120 |  | 
| 126 | 
            -
                    it 'must call setnx with key and value and set raw to true' do
         | 
| 127 | 
            -
                      redis.setnx(key, mock_value, options)
         | 
| 128 | 
            -
                      redis.has_setnx?(key, mock_value, :raw => true).must_equal true
         | 
| 129 | 
            -
                    end
         | 
| 130 | 
            -
             | 
| 131 121 | 
             
                    it 'must call expire' do
         | 
| 132 122 | 
             
                      redis.setnx(key, mock_value, options)
         | 
| 133 | 
            -
                      redis.has_expire?(key, options[:expire_after]).must_equal true
         | 
| 123 | 
            +
                      _(redis.has_expire?(key, options[:expire_after])).must_equal true
         | 
| 134 124 | 
             
                    end
         | 
| 135 125 | 
             
                  end
         | 
| 136 126 |  | 
| @@ -142,14 +132,9 @@ describe MockTtlStore do | |
| 142 132 | 
             
                      redis.setnx(key, mock_value, options)
         | 
| 143 133 | 
             
                    end
         | 
| 144 134 |  | 
| 145 | 
            -
                    it 'must call setnx with key and value and set raw to true' do
         | 
| 146 | 
            -
                      redis.setnx(key, mock_value, options)
         | 
| 147 | 
            -
                      redis.has_setnx?(key, mock_value, :raw => true).must_equal true
         | 
| 148 | 
            -
                    end
         | 
| 149 | 
            -
             | 
| 150 135 | 
             
                    it 'must call expire' do
         | 
| 151 136 | 
             
                      redis.setnx(key, mock_value, options)
         | 
| 152 | 
            -
                      redis.has_expire?(key, options[:expire_after]).must_equal true
         | 
| 137 | 
            +
                      _(redis.has_expire?(key, options[:expire_after])).must_equal true
         | 
| 153 138 | 
             
                    end
         | 
| 154 139 | 
             
                  end
         | 
| 155 140 | 
             
                end
         | 
    
        data/test/redis/store_test.rb
    CHANGED
    
    | @@ -12,7 +12,7 @@ describe Redis::Store do | |
| 12 12 | 
             
              end
         | 
| 13 13 |  | 
| 14 14 | 
             
              it "returns useful informations about the server" do
         | 
| 15 | 
            -
                @store.to_s.must_equal("Redis Client connected to #{@client.host}:#{@client.port} against DB #{@client.db}")
         | 
| 15 | 
            +
                _(@store.to_s).must_equal("Redis Client connected to #{@client.host}:#{@client.port} against DB #{@client.db}")
         | 
| 16 16 | 
             
              end
         | 
| 17 17 |  | 
| 18 18 | 
             
              it "must force reconnection" do
         | 
| @@ -41,15 +41,15 @@ describe Redis::Store do | |
| 41 41 |  | 
| 42 42 | 
             
                    # without options no ex or nx will be set
         | 
| 43 43 | 
             
                    @store.del(key)
         | 
| 44 | 
            -
                    @store.set(key, mock_value, {}).must_equal 'OK'
         | 
| 45 | 
            -
                    @store.set(key, mock_value, {}).must_equal 'OK'
         | 
| 46 | 
            -
                    @store.ttl(key).must_equal -1
         | 
| 44 | 
            +
                    _(@store.set(key, mock_value, {})).must_equal 'OK'
         | 
| 45 | 
            +
                    _(@store.set(key, mock_value, {})).must_equal 'OK'
         | 
| 46 | 
            +
                    _(@store.ttl(key)).must_equal -1
         | 
| 47 47 |  | 
| 48 48 | 
             
                    # with ex and nx options, the key can only be set once and a ttl will be set
         | 
| 49 49 | 
             
                    @store.del(key)
         | 
| 50 | 
            -
                    @store.set(key, mock_value, options).must_equal true
         | 
| 51 | 
            -
                    @store.set(key, mock_value, options).must_equal false
         | 
| 52 | 
            -
                    @store.ttl(key).must_equal 3600
         | 
| 50 | 
            +
                    _(@store.set(key, mock_value, options)).must_equal true
         | 
| 51 | 
            +
                    _(@store.set(key, mock_value, options)).must_equal false
         | 
| 52 | 
            +
                    _(@store.ttl(key)).must_equal 3600
         | 
| 53 53 | 
             
                  end
         | 
| 54 54 | 
             
                end
         | 
| 55 55 | 
             
              end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: redis-store
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1.9. | 
| 4 | 
            +
              version: 1.9.2
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Luca Guidi
         | 
| 8 | 
            -
            autorequire:
         | 
| 8 | 
            +
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2023-02-24 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: redis
         | 
| @@ -19,7 +19,7 @@ dependencies: | |
| 19 19 | 
             
                    version: '4'
         | 
| 20 20 | 
             
                - - "<"
         | 
| 21 21 | 
             
                  - !ruby/object:Gem::Version
         | 
| 22 | 
            -
                    version: ' | 
| 22 | 
            +
                    version: '6'
         | 
| 23 23 | 
             
              type: :runtime
         | 
| 24 24 | 
             
              prerelease: false
         | 
| 25 25 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| @@ -29,7 +29,7 @@ dependencies: | |
| 29 29 | 
             
                    version: '4'
         | 
| 30 30 | 
             
                - - "<"
         | 
| 31 31 | 
             
                  - !ruby/object:Gem::Version
         | 
| 32 | 
            -
                    version: ' | 
| 32 | 
            +
                    version: '6'
         | 
| 33 33 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 34 34 | 
             
              name: rake
         | 
| 35 35 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -180,9 +180,11 @@ extra_rdoc_files: [] | |
| 180 180 | 
             
            files:
         | 
| 181 181 | 
             
            - ".codeclimate.yml"
         | 
| 182 182 | 
             
            - ".github/auto-assign-issues.yml"
         | 
| 183 | 
            +
            - ".github/release.yml"
         | 
| 184 | 
            +
            - ".github/workflows/ci.yml"
         | 
| 185 | 
            +
            - ".github/workflows/publish.yml"
         | 
| 183 186 | 
             
            - ".gitignore"
         | 
| 184 187 | 
             
            - ".rubocop.yml"
         | 
| 185 | 
            -
            - ".travis.yml"
         | 
| 186 188 | 
             
            - Appraisals
         | 
| 187 189 | 
             
            - CHANGELOG.md
         | 
| 188 190 | 
             
            - CODEOWNERS
         | 
| @@ -192,7 +194,9 @@ files: | |
| 192 194 | 
             
            - Rakefile
         | 
| 193 195 | 
             
            - gemfiles/redis_4_0_x.gemfile
         | 
| 194 196 | 
             
            - gemfiles/redis_4_1_x.gemfile
         | 
| 197 | 
            +
            - gemfiles/redis_4_6_x.gemfile
         | 
| 195 198 | 
             
            - gemfiles/redis_4_x.gemfile
         | 
| 199 | 
            +
            - gemfiles/redis_5_x.gemfile
         | 
| 196 200 | 
             
            - lib/redis-store.rb
         | 
| 197 201 | 
             
            - lib/redis/distributed_store.rb
         | 
| 198 202 | 
             
            - lib/redis/store.rb
         | 
| @@ -218,7 +222,7 @@ homepage: http://redis-store.org/redis-store | |
| 218 222 | 
             
            licenses:
         | 
| 219 223 | 
             
            - MIT
         | 
| 220 224 | 
             
            metadata: {}
         | 
| 221 | 
            -
            post_install_message:
         | 
| 225 | 
            +
            post_install_message: 
         | 
| 222 226 | 
             
            rdoc_options: []
         | 
| 223 227 | 
             
            require_paths:
         | 
| 224 228 | 
             
            - lib
         | 
| @@ -233,8 +237,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 233 237 | 
             
                - !ruby/object:Gem::Version
         | 
| 234 238 | 
             
                  version: '0'
         | 
| 235 239 | 
             
            requirements: []
         | 
| 236 | 
            -
            rubygems_version: 3. | 
| 237 | 
            -
            signing_key:
         | 
| 240 | 
            +
            rubygems_version: 3.3.26
         | 
| 241 | 
            +
            signing_key: 
         | 
| 238 242 | 
             
            specification_version: 4
         | 
| 239 243 | 
             
            summary: Redis stores for Ruby frameworks
         | 
| 240 244 | 
             
            test_files: []
         | 
    
        data/.travis.yml
    DELETED
    
    | @@ -1,39 +0,0 @@ | |
| 1 | 
            -
            language: ruby
         | 
| 2 | 
            -
            sudo: false
         | 
| 3 | 
            -
            cache: bundler
         | 
| 4 | 
            -
            notifications:
         | 
| 5 | 
            -
              webhooks: https://www.travisbuddy.com
         | 
| 6 | 
            -
              on_success: never
         | 
| 7 | 
            -
            before_install:
         | 
| 8 | 
            -
            - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
         | 
| 9 | 
            -
              > ./cc-test-reporter
         | 
| 10 | 
            -
            - chmod +x ./cc-test-reporter
         | 
| 11 | 
            -
            rvm:
         | 
| 12 | 
            -
              - 2.3
         | 
| 13 | 
            -
              - 2.4
         | 
| 14 | 
            -
              - 2.5
         | 
| 15 | 
            -
              - 2.6
         | 
| 16 | 
            -
              - 2.7
         | 
| 17 | 
            -
              - ruby-head
         | 
| 18 | 
            -
              - jruby-head
         | 
| 19 | 
            -
            gemfile:
         | 
| 20 | 
            -
            - gemfiles/redis_4_0_x.gemfile
         | 
| 21 | 
            -
            - gemfiles/redis_4_1_x.gemfile
         | 
| 22 | 
            -
            - gemfiles/redis_4_x.gemfile
         | 
| 23 | 
            -
            before_script: "./cc-test-reporter before-build"
         | 
| 24 | 
            -
            after_script:
         | 
| 25 | 
            -
            - "./cc-test-reporter after-build --exit-code $EXIT_CODE"
         | 
| 26 | 
            -
            - "./cc-test-reporter format-coverage -t simplecov -o coverage/codeclimate.json"
         | 
| 27 | 
            -
            - if [[ "$TRAVIS_TEST_RESULT" == 0 ]]; then ./cc-test-reporter upload-coverage; fi
         | 
| 28 | 
            -
            matrix:
         | 
| 29 | 
            -
              allow_failures:
         | 
| 30 | 
            -
              - rvm: jruby-head
         | 
| 31 | 
            -
              - rvm: ruby-head
         | 
| 32 | 
            -
            deploy:
         | 
| 33 | 
            -
              provider: rubygems
         | 
| 34 | 
            -
              api_key:
         | 
| 35 | 
            -
                secure: vhwP2VNfVYgppPNis7asqMnWuIcURr2e99uhYeHS4Sc+hIozu2QzAAekDrVpEDpeaEubtmTi19UcV4dZbDrQ0M+buE8LJEpItz73yK++J75Rzyh/bsGnWTy2FIvedLrH+jBNf28I9p8XNWkQxVaTc/r/v6BX3mmyV/jVoTBz9es=
         | 
| 36 | 
            -
              gem: redis-store
         | 
| 37 | 
            -
              on:
         | 
| 38 | 
            -
                tags: true
         | 
| 39 | 
            -
                repo: redis-store/redis-store
         |