Sha256: 2a499d72cc5c334cb1bf972fcd8679233578a9df169be0de6da8d33a8fd1c209

Contents?: true

Size: 668 Bytes

Versions: 6

Compression:

Stored size: 668 Bytes

Contents

require 'spec_helper'

RSpec.describe Pause do
  describe 'adapter' do
    let(:configuration) { Pause::Configuration.new }

    before do
      Pause.adapter = nil
      allow(Pause).to receive(:config).and_return(configuration)
      configuration.configure { |c| c.sharded = sharded }
    end

    context 'pause is sharded' do
      let(:sharded) { true }

      it 'is a ShardedAdapter' do
        expect(Pause.adapter).to be_a(Pause::Redis::ShardedAdapter)
      end
    end

    context 'pause is not sharded' do
      let(:sharded) { false }

      it 'is an Adapter' do
        expect(Pause.adapter).to be_a(Pause::Redis::Adapter)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
pause-0.4.0 spec/pause/pause_spec.rb
pause-0.2.1 spec/pause/pause_spec.rb
pause-0.2.0 spec/pause/pause_spec.rb
pause-0.1.2 spec/pause/pause_spec.rb
pause-0.1.1 spec/pause/pause_spec.rb
pause-0.1.0 spec/pause/pause_spec.rb