Sha256: aefb014bebbbd44e7f71b5523f3a4f6d85068e5a576d687ad0cd4da67ace593f

Contents?: true

Size: 935 Bytes

Versions: 7

Compression:

Stored size: 935 Bytes

Contents

require 'spec_helper'

describe Berkshelf::API::CacheBuilder::Worker::FileStore do
  describe '.worker_type' do
    it 'is file_store' do
      expect(described_class.worker_type).to eq('file_store')
    end
  end

  subject do
    described_class.new(path: fixtures_path.join("cookbooks"))
  end

  it_behaves_like "a human-readable string"

  describe "#cookbooks" do
    it "returns an array containing an item for each valid cookbook on the server" do
      expect(subject.cookbooks.size).to eq(1)
    end

    it "returns an array of RemoteCookbooks" do
      subject.cookbooks.each do |cookbook|
        expect(cookbook).to be_a(Berkshelf::API::RemoteCookbook)
      end
    end

    it "each RemoteCookbook is tagged with a location_type matching the worker_type of the builder" do
      subject.cookbooks.each do |cookbook|
        expect(cookbook.location_type).to eql(described_class.worker_type)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
berkshelf-api-3.0.0 spec/unit/berkshelf/api/cache_builder/worker/file_store_spec.rb
berkshelf-api-2.2.0 spec/unit/berkshelf/api/cache_builder/worker/file_store_spec.rb
berkshelf-api-2.1.3 spec/unit/berkshelf/api/cache_builder/worker/file_store_spec.rb
berkshelf-api-2.1.2 spec/unit/berkshelf/api/cache_builder/worker/file_store_spec.rb
berkshelf-api-2.1.1 spec/unit/berkshelf/api/cache_builder/worker/file_store_spec.rb
berkshelf-api-2.1.0 spec/unit/berkshelf/api/cache_builder/worker/file_store_spec.rb
berkshelf-api-2.0.0 spec/unit/berkshelf/api/cache_builder/worker/file_store_spec.rb