We weren't splitting on whitespace, which is necessary
since the settings don't support arrays but files
expect them.

Signed-off-by: Luke Kanies <[email protected]>
---
 lib/puppet/configurer/downloader.rb |    2 +-
 spec/integration/configurer.rb      |   18 ++++++++++++++++++
 spec/unit/configurer/downloader.rb  |    8 +++++++-
 3 files changed, 26 insertions(+), 2 deletions(-)
 create mode 100755 spec/integration/configurer.rb

diff --git a/lib/puppet/configurer/downloader.rb 
b/lib/puppet/configurer/downloader.rb
index 9653c3a..7409fca 100644
--- a/lib/puppet/configurer/downloader.rb
+++ b/lib/puppet/configurer/downloader.rb
@@ -56,7 +56,7 @@ class Puppet::Configurer::Downloader
 
     def file
         args = default_arguments.merge(:path => path, :source => source)
-        args[:ignore] = ignore if ignore
+        args[:ignore] = ignore.split if ignore
         Puppet::Type.type(:file).new(args)
     end
 
diff --git a/spec/integration/configurer.rb b/spec/integration/configurer.rb
new file mode 100755
index 0000000..3bea0ea
--- /dev/null
+++ b/spec/integration/configurer.rb
@@ -0,0 +1,18 @@
+#!/usr/bin/env ruby
+
+require File.dirname(__FILE__) + '/../spec_helper'
+
+require 'puppet/configurer'
+
+describe Puppet::Configurer do
+    describe "when downloading plugins" do
+        it "should use the :pluginsignore setting, split on whitespace, for 
ignoring remote files" do
+            resource = Puppet::Type.type(:notify).new :name => "yay"
+            Puppet::Type.type(:file).expects(:new).with { |args| args[:ignore] 
== Puppet[:pluginsignore].split(/\s+/) }.returns resource
+
+            configurer = Puppet::Configurer.new
+            configurer.stubs(:download_plugins?).returns true
+            configurer.download_plugins
+        end
+    end
+end
diff --git a/spec/unit/configurer/downloader.rb 
b/spec/unit/configurer/downloader.rb
index bc23574..80de8db 100755
--- a/spec/unit/configurer/downloader.rb
+++ b/spec/unit/configurer/downloader.rb
@@ -82,10 +82,16 @@ describe Puppet::Configurer::Downloader do
         end
 
         it "should support providing an 'ignore' parameter" do
-            Puppet::Type.type(:file).expects(:new).with { |opts| opts[:ignore] 
== ".svn" }
+            Puppet::Type.type(:file).expects(:new).with { |opts| opts[:ignore] 
== [".svn"] }
             @dler = Puppet::Configurer::Downloader.new("foo", "path", 
"source", ".svn")
             @dler.file
         end
+
+        it "should split the 'ignore' parameter on whitespace" do
+            Puppet::Type.type(:file).expects(:new).with { |opts| opts[:ignore] 
== %w{.svn CVS} }
+            @dler = Puppet::Configurer::Downloader.new("foo", "path", 
"source", ".svn CVS")
+            @dler.file
+        end
     end
 
     describe "when creating the catalog to do the downloading" do
-- 
1.6.1


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to