Sha256: e84a1401d97bd0aaa087970c63726e049eb46dd13e47646a2f4db2392ad3b5de

Contents?: true

Size: 569 Bytes

Versions: 11

Compression:

Stored size: 569 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "Rapnd" do  
  before do
    Rapnd.config do |config|
      config.redis_host = 'localhost'
      config.redis_port = 9876
    end
    
    @redis = Redis.new(:host => 'localhost', :port => 9876)
  end
  
  it 'enqueues a message' do
    Rapnd.queue('test_queue', {:alert => 'Hi!'})
    
    @redis.llen('test_queue').should == 1
    Marshal.load(@redis.lpop('test_queue')).should == {:alert => 'Hi!'}
  end
  
  it 'gets a redis connection' do
    Rapnd.redis.ping.should == "PONG"
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
rapnd-mikec54088-0.5.5 spec/rapnd_spec.rb
rapnd-mikec54088-0.5.4 spec/rapnd_spec.rb
rapnd-mikec54088-0.5.3 spec/rapnd_spec.rb
rapnd-mikec54088-0.5.2 spec/rapnd_spec.rb
rapnd-mikec54088-0.5.1 spec/rapnd_spec.rb
rapnd-mikec54088-0.5.0 spec/rapnd_spec.rb
rapnd-0.5.0 spec/rapnd_spec.rb
rapnd-0.4.1 spec/rapnd_spec.rb
rapnd-0.4.0 spec/rapnd_spec.rb
rapnd-0.3.1 spec/rapnd_spec.rb
rapnd-0.3.0 spec/rapnd_spec.rb