diff options
| author | Markus Roberts <Markus@reality.com> | 2009-12-17 19:58:27 -0800 |
|---|---|---|
| committer | James Turnbull <james@lovedthanlost.net> | 2009-12-20 09:15:36 +1100 |
| commit | 813cb58815f1f8f987ad64f7c7bfb640fbcdfa81 (patch) | |
| tree | c93b3ce57cc66d6cca3eb8e43d50e087b335b050 /spec/unit/application | |
| parent | e9a0cb7a28a34fd04db4bfe1db347da5d774f2e8 (diff) | |
Fix for #2765 (--no-fqdn regression in puppetrun)
This is basically the fix suggested on the ticket, cleaned up and
ruby-ized, with tests. The only functional modification is leaving
the default on entry2hash as --no-fqdn to preserve 0.25.1 behaviour
as the default.
Signed- ff-by: Markus Roberts <Markus@reality.com>
Diffstat (limited to 'spec/unit/application')
| -rwxr-xr-x | spec/unit/application/puppetrun.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/spec/unit/application/puppetrun.rb b/spec/unit/application/puppetrun.rb index d44b406e9..26811f0db 100755 --- a/spec/unit/application/puppetrun.rb +++ b/spec/unit/application/puppetrun.rb @@ -144,11 +144,21 @@ describe "puppetrun" do Puppet.stubs(:[]).with(:node_terminus).returns("ldap") end + it "should pass the fqdn option to search" do + @puppetrun.options.stubs(:[]).with(:fqdn).returns(:something) + @puppetrun.options.stubs(:[]).with(:all).returns(true) + @puppetrun.stubs(:puts) + + Puppet::Node.expects(:search).with("whatever",:fqdn => :something).returns([]) + + @puppetrun.run_setup + end + it "should search for all nodes if --all" do @puppetrun.options.stubs(:[]).with(:all).returns(true) @puppetrun.stubs(:puts) - Puppet::Node.expects(:search).with("whatever").returns([]) + Puppet::Node.expects(:search).with("whatever",:fqdn => nil).returns([]) @puppetrun.run_setup end @@ -158,7 +168,7 @@ describe "puppetrun" do @puppetrun.stubs(:puts) @puppetrun.classes = ['class'] - Puppet::Node.expects(:search).with("whatever", :class => "class").returns([]) + Puppet::Node.expects(:search).with("whatever", :class => "class", :fqdn => nil).returns([]) @puppetrun.run_setup end |
