spec/lib/extensions/memcached_connection_spec.rb in memcached-manager-0.4.0 vs spec/lib/extensions/memcached_connection_spec.rb in memcached-manager-1.0.0

- old
+ new

@@ -2,24 +2,29 @@ describe Sinatra::MemcachedConnection do let(:klass) { Class.new.extend(Sinatra::MemcachedConnection) } context "#setup_memcached" do - before(:each) { klass.setup_memcached 'localhost', '1337' } - it { klass.should have_instance_variable(:memcached) } + before { klass.setup_memcached 'localhost', '1337' } + it { expect(klass).to have_instance_variable(:memcached) } end context "#close_memcached" do before(:each) { klass.setup_memcached 'localhost', '1337' } # There isn't an Dalli api that tells if the connection is closed it { klass.respond_to? :close_memcached } end context "#memcached_connection" do - before(:each) { klass.setup_memcached 'localhost', '1337' } + before { klass.setup_memcached 'localhost', '1337' } it "should be the instance variable of memcached" do - klass.instance_variable_get(:"@memcached").should be klass.memcached_connection + expect(klass.instance_variable_get(:"@memcached")).to eq klass.memcached_connection end + end + + context '#memcached_connected?', wip: true do + it { expect(klass.memcached_connected?('localhost', '11211')).to be_truthy } + it { expect(klass.memcached_connected?('localhost', '1121')).to be_falsy } end end