Sha256: eec4161f57ad228ff5f3ac56673320c3cb5b0abf28b0ecc5b61bcd58a1108a6f

Contents?: true

Size: 1021 Bytes

Versions: 14

Compression:

Stored size: 1021 Bytes

Contents

require 'spec_helper'

describe Berkshelf::Config do
  let(:klass) { described_class }

  describe "ClassMethods" do
    subject { klass }

    describe "::file" do
      subject { klass.file }

      context "when the file does not exist" do
        before :each do
          File.stub exists?: false
        end

        it { should be_nil }
      end
    end

    describe "::instance" do
      subject { klass.instance }

      it { should be_a klass }
    end

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

      it { should be_a String }

      it "points to a location within ENV['BERKSHELF_PATH']" do
        ENV.stub(:[]).with('BERKSHELF_PATH').and_return('/tmp')

        subject.should eql("/tmp/config.json")
      end
    end

    describe "::chef_config" do
      it "returns the Chef::Config" do
        subject.chef_config.should eql(Chef::Config)
      end
    end

    describe "::chef_config_path" do
      subject { klass.chef_config_path }

      it { should be_a String }
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
berkshelf-1.1.6 spec/unit/berkshelf/config_spec.rb
berkshelf-1.1.5 spec/unit/berkshelf/config_spec.rb
berkshelf-1.1.4 spec/unit/berkshelf/config_spec.rb
berkshelf-1.1.3 spec/unit/berkshelf/config_spec.rb
berkshelf-1.1.2 spec/unit/berkshelf/config_spec.rb
berkshelf-1.1.1 spec/unit/berkshelf/config_spec.rb
berkshelf-1.1.0 spec/unit/berkshelf/config_spec.rb
berkshelf-1.1.0.rc1 spec/unit/berkshelf/config_spec.rb
berkshelf-1.0.4 spec/unit/berkshelf/config_spec.rb
berkshelf-1.0.3 spec/unit/berkshelf/config_spec.rb
berkshelf-1.0.2 spec/unit/berkshelf/config_spec.rb
berkshelf-1.0.0 spec/unit/berkshelf/config_spec.rb
berkshelf-1.0.0.rc3 spec/unit/berkshelf/config_spec.rb
berkshelf-1.0.0.rc2 spec/unit/berkshelf/config_spec.rb