diff options
| author | Jesse Wolfe <jes5199@gmail.com> | 2010-04-26 14:30:12 -0700 |
|---|---|---|
| committer | test branch <puppet-dev@googlegroups.com> | 2010-02-17 06:50:53 -0800 |
| commit | 5b64d3b798b79357f98f100fc027d73518320ddf (patch) | |
| tree | 5c241e0300f89a6d06d671255b2e713122a293e6 /spec/unit/application | |
| parent | 5683fd983b9a165ffbb8f08e67cfe903ec0e41b7 (diff) | |
| download | puppet-5b64d3b798b79357f98f100fc027d73518320ddf.tar.gz puppet-5b64d3b798b79357f98f100fc027d73518320ddf.tar.xz puppet-5b64d3b798b79357f98f100fc027d73518320ddf.zip | |
feature #2276 Single Executable: optparser should get CommandLine#args instead of ARGV
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
Diffstat (limited to 'spec/unit/application')
| -rwxr-xr-x | spec/unit/application/agent.rb | 12 | ||||
| -rw-r--r-- | spec/unit/application/master.rb | 10 |
2 files changed, 5 insertions, 17 deletions
diff --git a/spec/unit/application/agent.rb b/spec/unit/application/agent.rb index fbcc61be3..2439feae2 100755 --- a/spec/unit/application/agent.rb +++ b/spec/unit/application/agent.rb @@ -92,13 +92,7 @@ describe Puppet::Application::Agent do describe "when handling options" do before do - @old_argv = ARGV.dup - ARGV.clear - end - - after do - ARGV.clear - @old_argv.each { |a| ARGV << a } + @puppetd.command_line.stubs(:args).returns([]) end [:centrallogging, :disable, :enable, :debug, :fqdn, :test, :verbose, :digest].each do |option| @@ -154,8 +148,8 @@ describe Puppet::Application::Agent do @puppetd.handle_logdest("console") end - it "should parse the log destination from ARGV" do - ARGV << "--logdest" << "/my/file" + it "should parse the log destination from the command line" do + @puppetd.command_line.stubs(:args).returns(%w[--logdest /my/file]) Puppet::Util::Log.expects(:newdestination).with("/my/file") diff --git a/spec/unit/application/master.rb b/spec/unit/application/master.rb index 2672fdb16..362769e53 100644 --- a/spec/unit/application/master.rb +++ b/spec/unit/application/master.rb @@ -80,13 +80,7 @@ describe Puppet::Application::Master do describe "when applying options" do before do - @old_argv = ARGV.dup - ARGV.clear - end - - after do - ARGV.clear - @old_argv.each { |a| ARGV << a } + @master.command_line.stubs(:args).returns([]) end it "should set the log destination with --logdest" do @@ -102,7 +96,7 @@ describe Puppet::Application::Master do end it "should parse the log destination from ARGV" do - ARGV << "--logdest" << "/my/file" + @master.command_line.stubs(:args).returns(%w[--logdest /my/file]) Puppet::Util::Log.expects(:newdestination).with("/my/file") |
