Sha256: fe2392c953a09967b71bd1fb3a6ab14a765f0861cb3a3f1289a7982f4d894473

Contents?: true

Size: 1.26 KB

Versions: 34

Compression:

Stored size: 1.26 KB

Contents

require "spec_helper"

module Berkshelf
  describe ChefRepoUniverse do
    let(:fixture) { nil }
    let(:fixture_path) { File.expand_path("../../../fixtures/#{fixture}", __FILE__) }
    subject { described_class.new("file://#{fixture_path}", path: fixture_path).universe }

    context "with cookbooks in ./" do
      let(:fixture) { "cookbook-path" }

      it "returns the correct universe" do
        expect(subject.size).to eq 1
        expect(subject[0].name).to eq "jenkins-config"
        expect(subject[0].version).to eq "0.1.0"
        expect(subject[0].dependencies).to eq "jenkins" => "~> 2.0"
      end
    end

    context "with cookbooks in cookbooks/" do
      let(:fixture) { "complex-cookbook-path" }

      it "returns the correct universe" do
        expect(subject.size).to eq 3
        expect(subject[0].name).to eq "app"
        expect(subject[0].version).to eq "1.2.3"
        expect(subject[0].dependencies).to eq({})
        expect(subject[1].name).to eq "jenkins"
        expect(subject[1].version).to eq "2.0.1"
        expect(subject[1].dependencies).to eq({})
        expect(subject[2].name).to eq "jenkins-config"
        expect(subject[2].version).to eq "0.1.0"
        expect(subject[2].dependencies).to eq "jenkins" => "~> 2.0"
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
berkshelf-8.0.15 spec/unit/berkshelf/chef_repo_universe_spec.rb
berkshelf-8.0.13 spec/unit/berkshelf/chef_repo_universe_spec.rb
berkshelf-8.0.12 spec/unit/berkshelf/chef_repo_universe_spec.rb
berkshelf-8.0.9 spec/unit/berkshelf/chef_repo_universe_spec.rb
berkshelf-8.0.7 spec/unit/berkshelf/chef_repo_universe_spec.rb
berkshelf-8.0.5 spec/unit/berkshelf/chef_repo_universe_spec.rb
berkshelf-8.0.2 spec/unit/berkshelf/chef_repo_universe_spec.rb
berkshelf-8.0.1 spec/unit/berkshelf/chef_repo_universe_spec.rb
berkshelf-8.0.0 spec/unit/berkshelf/chef_repo_universe_spec.rb
berkshelf-7.2.2 spec/unit/berkshelf/chef_repo_universe_spec.rb
berkshelf-7.2.1 spec/unit/berkshelf/chef_repo_universe_spec.rb
berkshelf-7.2.0 spec/unit/berkshelf/chef_repo_universe_spec.rb
berkshelf-7.1.0 spec/unit/berkshelf/chef_repo_universe_spec.rb
berkshelf-7.0.10 spec/unit/berkshelf/chef_repo_universe_spec.rb
berkshelf-7.0.9 spec/unit/berkshelf/chef_repo_universe_spec.rb
berkshelf-7.0.8 spec/unit/berkshelf/chef_repo_universe_spec.rb
berkshelf-7.0.7 spec/unit/berkshelf/chef_repo_universe_spec.rb
berkshelf-6.3.4 spec/unit/berkshelf/chef_repo_universe_spec.rb
berkshelf-7.0.6 spec/unit/berkshelf/chef_repo_universe_spec.rb
berkshelf-7.0.5 spec/unit/berkshelf/chef_repo_universe_spec.rb