Sha256: e9ce2068e741eddb83d0c2d98251b9bd91cb4271b8907566df02eb52d6e5daf3

Contents?: true

Size: 1005 Bytes

Versions: 2

Compression:

Stored size: 1005 Bytes

Contents

require 'spec_helper'

describe CephStorage::PoolEnumerator do
  let(:config) { cluster_config }
  let(:spconfig) { spec_config }
  let(:cluster) { CephStorage::ClusterFactory.build config }
  let(:pool_name) { spconfig[:pool][:name] }
  let(:pool) { cluster.pool(pool_name) }
  let(:object_name) { spconfig[:pool][:object] }
  let(:pool_enumerator) { cluster.pools }
  subject { pool_enumerator }

  it 'should be a CephStorage::PoolEnumerator' do
    expect(subject).to be_a ::CephStorage::PoolEnumerator
  end

  describe 'before pool creation' do
    it 'should not have the test pool in it' do
      expect(subject.any? { |p| p.name ==  pool_name }).to be false
    end
  end

  describe 'after pool creation' do
    before { pool.create }
    after { pool.destroy }
    it 'should have the test pool in it' do
      expect(subject.any? { |p| p.name ==  pool_name }).to be true
    end

    it 'should return pool objects' do
      expect(subject.first).to be_a ::CephStorage::Pool
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ceph_storage-0.1.1 spec/ceph_storage_pool_enumerator.rb
ceph_storage-0.1.0 spec/ceph_storage_pool_enumerator.rb