Sha256: d6325650a18fba17206e4141c42d04624194f2fa410bacea3332ea97557c6922

Contents?: true

Size: 550 Bytes

Versions: 1

Compression:

Stored size: 550 Bytes

Contents

require 'spec_helper'

describe Backend do
  before :each do
    Backend.stub(:host)
    Backend.stub(:port)
    Redis.stub(:new){ double(:redis) }
  end

  describe 'redis' do
    it 'create only one connection' do
      Redis.should_receive(:new).once
      Backend.redis
      Backend.redis
    end
  end

  describe 'performance_stats' do
    before :each do
      PerformanceStats.any_instance.stub(:results){ {} }
    end

    it 'should return a hash with the stats' do
      Backend.performance_stats.should be_kind_of(Hash)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
redis_monitor-0.0.4 spec/modules/backend_spec.rb