Sha256: 0e65f1077709fc9f1532f22ffcb955ded925ff185ece9adc18c57f444c07521f

Contents?: true

Size: 1.31 KB

Versions: 11

Compression:

Stored size: 1.31 KB

Contents

require 'spec_helper'

describe MB::Berkshelf do
  describe "::cookbooks_path" do
    subject { described_class.cookbooks_path }

    it "returns a Pathname" do
      subject.should be_a(Pathname)
    end

    it "is in the Berkshelf path" do
      subject.to_s.should include(MB::Berkshelf.path.to_s)
    end
  end

  describe "::default_path" do
    subject { described_class.default_path }

    it "returns a String" do
      subject.should be_a(String)
    end

    it "returns the value of ENV['BERKSHELF_PATH'] if present" do
      target = "/tmp/berkshelf"
      ENV.stub(:[]).with("BERKSHELF_PATH").and_return(target)

      subject.should eql(target)
    end
  end

  describe "::path" do
    subject { described_class.path }

    it "returns a Pathname" do
      subject.should be_a(Pathname)
    end
  end

  describe MB::Berkshelf::Lockfile do
    describe "#locked_versions" do

      let(:plugin_path) { '/foo' }
      subject { MB::Berkshelf::Lockfile.from_path(plugin_path) }

      context "when there is no lockfile present" do
        its(:locked_versions) { should == {} }
      end

      context "when there is a lockfile present" do
        let(:plugin_path) { fixtures_path.join('myface-0.1.0') }
        its(:locked_versions) { should == {'cookbook1' => '2.0.1', 'cookbook2' => '1.0.13'}}
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
motherbrain-1.5.0 spec/unit/mb/berkshelf_spec.rb
motherbrain-1.4.0 spec/unit/mb/berkshelf_spec.rb
motherbrain-1.3.0 spec/unit/mb/berkshelf_spec.rb
motherbrain-1.2.1 spec/unit/mb/berkshelf_spec.rb
motherbrain-1.2.0 spec/unit/mb/berkshelf_spec.rb
motherbrain-1.1.3 spec/unit/mb/berkshelf_spec.rb
motherbrain-1.1.2 spec/unit/mb/berkshelf_spec.rb
motherbrain-1.1.1 spec/unit/mb/berkshelf_spec.rb
motherbrain-1.1.0 spec/unit/mb/berkshelf_spec.rb
motherbrain-1.0.0 spec/unit/mb/berkshelf_spec.rb
motherbrain-0.14.5 spec/unit/mb/berkshelf_spec.rb