summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel DeLeo <dan@opscode.com>2010-07-01 12:56:07 -0700
committerDaniel DeLeo <dan@opscode.com>2010-07-02 13:34:42 -0700
commit7c5abfc7684076f52edaf5d1510dcb21cfbad3fa (patch)
tree3464dd387b069224be22fadf3af7ee98dca0bf8f
parente4fa84dee534a2174352789cb8cd1092cc90147c (diff)
downloadchef-0_9_6.tar.gz
use the hash syntax to set solo mode, require 'chef' in solo app0.9.60_9_6
-rw-r--r--chef/lib/chef/application/solo.rb3
-rw-r--r--chef/spec/unit/application/solo_spec.rb5
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