diff options
author | danielsdeleo <dan@opscode.com> | 2013-10-18 14:41:36 -0700 |
---|---|---|
committer | danielsdeleo <dan@opscode.com> | 2013-10-18 16:20:50 -0700 |
commit | 5d0247a7f3da53d92650fa961a65b9f7b962ac0b (patch) | |
tree | 5e5f0e1abe34e343a3cb5573c68bf0ec473f7027 /spec/unit | |
parent | 29a4bf596bf1965a135674404ae660a06c97355c (diff) | |
download | chef-5d0247a7f3da53d92650fa961a65b9f7b962ac0b.tar.gz |
Add a means to detect the 'embedded' dir in omnibus
Diffstat (limited to 'spec/unit')
-rw-r--r-- | spec/unit/config_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/unit/config_spec.rb b/spec/unit/config_spec.rb index cb48ab5bcc..e887c05202 100644 --- a/spec/unit/config_spec.rb +++ b/spec/unit/config_spec.rb @@ -266,6 +266,27 @@ describe Chef::Config do end end + + describe "finding the windows embedded dir" do + let(:default_config_location) { "c:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/config.rb" } + let(:alternate_install_location) { "c:/my/alternate/install/place/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/config.rb" } + let(:non_omnibus_location) { "c:/my/dev/stuff/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/config.rb" } + + it "finds the embedded dir in the default location" do + Chef::Config.stub(:_this_file).and_return(default_config_location) + Chef::Config.embedded_dir.should == "c:/opscode/chef/embedded" + end + + it "finds the embedded dir in a custom install location" do + Chef::Config.stub(:_this_file).and_return(alternate_install_location) + Chef::Config.embedded_dir.should == "c:/my/alternate/install/place/chef/embedded" + end + + it "doesn't error when not in an omnibus install" do + Chef::Config.stub(:_this_file).and_return(non_omnibus_location) + Chef::Config.embedded_dir.should be_nil + end + end end describe "Chef::Config[:user_home]" do |