Sha256: 8aa4cf6738cd49cac9215a2f264a01c9d5a5c0652ff9f15bcdb714d771a8e203

Contents?: true

Size: 737 Bytes

Versions: 2

Compression:

Stored size: 737 Bytes

Contents

require File.join(File.dirname(__FILE__), "..", "spec_helper.rb")

describe 'Ampere', :ampere => true do
  before :all do
    Ampere.connect
    Redis.new.flushall
  end
  
  it 'should be able to connect' do
    Ampere.should be_connected
  end
  
  it 'should be able to flush' do
    value = "%016x" % rand(2 ** 64)
    Ampere.should be_connected
    Ampere.connection.setex("ampere.test.flush_test", 60, value)
    Ampere.flush
    Ampere.connection.get("ampere.test.flush_test").should_not eq(value)
  end
  
  it 'should be able to disconnect' do
    # NOTE: This test must always be run last
    Ampere.disconnect
    Ampere.should_not be_connected
  end
  
  after :all do
    Redis.new.flushall
    Ampere.disconnect
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ampere-1.2.3 spec/module/ampere_spec.rb
ampere-1.2.2 spec/module/ampere_spec.rb