Skip to content

Commit

Permalink
use the hash syntax to set solo mode, require 'chef' in solo app
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsdeleo committed Jul 1, 2010
1 parent 1876788 commit 7c91895
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion chef/lib/chef/application/solo.rb
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion chef/spec/unit/application/solo_spec.rb
Expand Up @@ -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
Expand Down

0 comments on commit 7c91895

Please sign in to comment.