Permalink
Browse files

use the hash syntax to set solo mode, require 'chef' in solo app

  • Loading branch information...
1 parent e4fa84d commit 7c5abfc7684076f52edaf5d1510dcb21cfbad3fa @danielsdeleo danielsdeleo committed Jul 1, 2010
Showing with 6 additions and 2 deletions.
  1. +2 −1 chef/lib/chef/application/solo.rb
  2. +4 −1 chef/spec/unit/application/solo_spec.rb
View
3 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 @@ def initialize
def reconfigure
super
- Chef::Config.solo true
+ Chef::Config[:solo] = true
if Chef::Config[:daemonize]
Chef::Config[:interval] ||= 1800
View
5 chef/spec/unit/application/solo_spec.rb
@@ -29,16 +29,19 @@
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

0 comments on commit 7c5abfc

Please sign in to comment.