diff options
author | Daniel DeLeo <dan@opscode.com> | 2010-07-01 12:56:07 -0700 |
---|---|---|
committer | Daniel DeLeo <dan@opscode.com> | 2010-07-01 12:56:07 -0700 |
commit | 7c918959fa53e9547980422e1693cdd810f67a2b (patch) | |
tree | e70529b732e694bc04c629897a669eecd6d5651e | |
parent | 187678899f87a6bb86f53a5b46b77eb4be1b6bd6 (diff) | |
download | chef-7c918959fa53e9547980422e1693cdd810f67a2b.tar.gz |
use the hash syntax to set solo mode, require 'chef' in solo app
-rw-r--r-- | chef/lib/chef/application/solo.rb | 3 | ||||
-rw-r--r-- | chef/spec/unit/application/solo_spec.rb | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/chef/lib/chef/application/solo.rb b/chef/lib/chef/application/solo.rb index 1a580c197e..642dd8d354 100644 --- a/chef/lib/chef/application/solo.rb +++ b/chef/lib/chef/application/solo.rb @@ -15,6 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +require 'chef' require 'chef/application' require 'chef/client' require 'chef/config' @@ -118,7 +119,7 @@ class Chef::Application::Solo < Chef::Application def reconfigure super - Chef::Config.solo true + Chef::Config[:solo] = true if Chef::Config[:daemonize] Chef::Config[:interval] ||= 1800 diff --git a/chef/spec/unit/application/solo_spec.rb b/chef/spec/unit/application/solo_spec.rb index 7753efecf2..b6b7e8414c 100644 --- a/chef/spec/unit/application/solo_spec.rb +++ b/chef/spec/unit/application/solo_spec.rb @@ -29,16 +29,19 @@ describe Chef::Application::Solo do Chef::Config[:recipe_url] = false Chef::Config[:json_attribs] = false Chef::Config[:splay] = nil + Chef::Config[:solo] = true end after do + Chef::Config[:solo] = nil Chef::Config.configuration.replace(@original_config) + Chef::Config[:solo] = false end describe "configuring the application" do it "should set solo mode to true" do - Chef::Config.should_receive(:solo).once.with(true).and_return(true) @app.reconfigure + Chef::Config[:solo].should be_true end describe "when in daemonized mode and no interval has been set" do |