Sha256: 514f3521f97cb313be03ca39e8d6dce5140a0c871ac9ea33deffc1355eb94615

Contents?: true

Size: 1.61 KB

Versions: 1

Compression:

Stored size: 1.61 KB

Contents

require 'spec_helper'

describe CephRuby::Pool do
  let(:config) { cluster_config }
  let(:spconfig) { spec_config }
  let(:cluster) { ::CephRuby::Cluster.new(config) }
  let(:name) { spconfig[:pool][:name] }
  let(:pool_enumerator) { cluster.pools }
  subject { pool_enumerator }
  before do
    RSpec.configure do |c|
      c.filter_run_excluding(
        requires_create_delete: true
      ) unless spconfig[:pool][:create_delete]
      c.filter_run_excluding(
        requires_create_delete: false
      ) if spconfig[:pool][:create_delete]
    end
  end

  describe 'PoolEnumerator Object' do
    it 'Should be a ::CephRuby::PoolEnumerator object' do
      expect(subject).to be_a ::CephRuby::PoolEnumerator
    end

    it 'should respond to each' do
      expect(subject).to respond_to :each
    end

    it 'should respond to size' do
      expect(subject).to respond_to :size
    end

    describe 'without the test pool created', requires_create_delete: true do
      it 'should not include the test pool' do
        expect(subject.include?(cluster.pool(name))).to be false
      end

      describe 'with the test pool created', requires_create_delete: true do
        before { cluster.pool(name, &:create) }
        after { cluster.pool(name, &:destroy) }
        subject { cluster.pools }
        it 'should include the test pool' do
          expect(subject.include?(cluster.pool(name))).to be true
        end
      end
    end

    describe 'when already created', requires_create_delete: false do
      it 'should include the test pool' do
        expect(subject.include?(cluster.pool(name))).to be true
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ceph-ruby-livelink-1.5.1 spec/ceph_ruby_pool_enumerator_spec.rb