Sha256: 1f9512f7b42056734a12dd06ffc84c22eeaf562eabf3530a2fb7416056128f7e
Contents?: true
Size: 1.66 KB
Versions: 6
Compression:
Stored size: 1.66 KB
Contents
require 'spec_helper' describe "directory environments" do let(:args) { ['--configprint', 'modulepath', '--environment', 'direnv'] } let(:puppet) do app = Puppet::Application[:apply] app.stubs(:command_line).returns(stub('command_line', :args => [])) app end context "with a single directory environmentpath" do before(:each) do environmentdir = Puppet[:environmentpath].split(File::PATH_SEPARATOR).first FileUtils.mkdir_p(environmentdir + "/direnv/modules") end it "config prints the environments modulepath" do Puppet.settings.initialize_global_settings(args) expect do expect { puppet.run }.to exit_with(0) end.to have_printed('direnv/modules') end it "config prints the cli --modulepath despite environment" do args << '--modulepath' << 'completely/different' Puppet.settings.initialize_global_settings(args) expect do expect { puppet.run }.to exit_with(0) end.to have_printed('completely/different') end end context "with an environmentpath having multiple directories" do let(:args) { ['--configprint', 'modulepath', '--environment', 'otherdirenv'] } before(:each) do envdir1 = File.join(Puppet[:confdir], 'env1') envdir2 = File.join(Puppet[:confdir], 'env2') Puppet[:environmentpath] = [envdir1, envdir2].join(File::PATH_SEPARATOR) FileUtils.mkdir_p(envdir2 + "/otherdirenv/modules") end it "config prints a directory environment modulepath" do Puppet.settings.initialize_global_settings(args) expect do expect { puppet.run }.to exit_with(0) end.to have_printed('otherdirenv/modules') end end end
Version data entries
6 entries across 6 versions & 1 rubygems