diff options
Diffstat (limited to 'spec/unit/config_spec.rb')
-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 |