diff options
| author | Matt Robinson <matt@puppetlabs.com> | 2010-06-30 12:43:23 -0700 |
|---|---|---|
| committer | Markus Roberts <Markus@reality.com> | 2010-07-01 13:48:03 -0700 |
| commit | 2a2588392a2eead4265afcb93ff7bc16b5fc1ef1 (patch) | |
| tree | 128c7039ced805af716cd49c25690634de5243ad /spec/unit/application | |
| parent | 75e0662168936da8255507a10bccad8889326947 (diff) | |
[#4090] Git rid of the idea that run_mode is a configurable option with defaults
Along the way this fixes an issue with 2.6 alpha that sections of the
puppet config file were getting ignored.
Diffstat (limited to 'spec/unit/application')
| -rwxr-xr-x | spec/unit/application/agent_spec.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/unit/application/agent_spec.rb b/spec/unit/application/agent_spec.rb index 76a378e82..21f5143bd 100755 --- a/spec/unit/application/agent_spec.rb +++ b/spec/unit/application/agent_spec.rb @@ -8,6 +8,31 @@ require 'puppet/network/server' require 'puppet/daemon' describe Puppet::Application::Agent do + it "should ask Puppet::Application to parse Puppet configuration file" do + agent = Puppet::Application::Agent.new + agent.preinit + + Puppet[:vardir].should == '/dev/null' + Puppet[:report].should be_false + + text = <<-CONF + [main] + vardir='/foo/bar' + [puppetd] + report=true + CONF + + FileTest.expects(:exist?).with('file').returns true + Puppet.settings.expects(:read_file).returns(text) + + Puppet.settings.unsafe_parse('file') + + Puppet[:vardir].should == '/foo/bar' + Puppet[:report].should be_true + end +end + +describe Puppet::Application::Agent do before :each do @puppetd = Puppet::Application[:agent] @puppetd.stubs(:puts) |
