Sha256: c88c3ce81adc89ca343683999fb466cfee9ed35de2f4a62fb5b42edcad8af96d
Contents?: true
Size: 1.34 KB
Versions: 1
Compression:
Stored size: 1.34 KB
Contents
require "spec_helper" describe DeviseCasAuthenticatable::MemcacheChecker do let(:conf_double) { stub(session_options: {}) } describe '#session_store_memcache?' do subject(:session_store_memcache?) { described_class.new(conf_double).session_store_memcache? } before do DeviseCasAuthenticatable::SessionStoreIdentifier.any_instance .stubs(:session_store_class).returns(session_store_class) end context "when session store is memcache" do let(:session_store_class) { FakeMemcacheStore } it { expect(session_store_memcache?).to eq true } end context "when session store is NOT memcache" do let(:session_store_class) { String } it { expect(session_store_memcache?).to eq false } end end describe 'alive?' do context "when memcache is down" do let(:conf_double) { stub(session_options: {memcache_server: ['127.0.0.1:11223']}) } subject(:alive?) { described_class.new(conf_double).alive? } it { expect(alive?).to eq false } end context "when memcache is running" do let(:conf_double) { stub(session_options: {memcache_server: ['127.0.0.1:11214']}) } subject(:alive?) { described_class.new(conf_double).alive? } before do Net::Telnet.stubs(:new) end it { expect(alive?).to eq true } end end end class FakeMemcacheStore end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
devise_cas_authenticatable-1.8.0 | spec/memcache_checker_spec.rb |