Sha256: 6247be290af22435767c77289cbba129d3a3c921a955c6bbbce15db232060b26

Contents?: true

Size: 861 Bytes

Versions: 2

Compression:

Stored size: 861 Bytes

Contents

RSpec.describe ChefVault do
  let(:vault) { ChefVault.new("foo") }

  describe '#new' do
    context "with only a vault parameter specified" do

      it "assigns 'foo' to the vault accessor" do
        expect(vault.vault).to eq "foo"
      end
    end
  end

  context "with a vault and config file parameter specified" do
    before do
      allow(IO).to receive(:read).with("knife.rb").and_return("node_name 'myserver'")
    end

    let(:vault) { ChefVault.new("foo", "knife.rb") }

    it "assigns 'foo' to the vault accessor" do
        expect(vault.vault).to eq "foo"
    end

    it "loads the Chef config values" do
      expect(ChefVault).to receive(:load_config).with("knife.rb")
      vault
    end
  end

  describe '#version' do
    it "the version method equals VERSION" do
      expect(vault.version).to eq(ChefVault::VERSION)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chef-vault-2.8.0.rc1 spec/chef-vault_spec.rb
chef-vault-2.7.1 spec/chef-vault_spec.rb