summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-08-05 17:57:31 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-08-05 17:57:31 +0000
commit7bda32e9fbb6fb63c5f33fa839f03cc305c2b449 (patch)
tree0dc12c1f3bad21d7924b72d194dcfd8e7a96a9d6 /test
parent3d629bb2b237a7bd93e70a029739cb68ee6f9c7c (diff)
downloadpuppet-7bda32e9fbb6fb63c5f33fa839f03cc305c2b449.tar.gz
puppet-7bda32e9fbb6fb63c5f33fa839f03cc305c2b449.tar.xz
puppet-7bda32e9fbb6fb63c5f33fa839f03cc305c2b449.zip
Fixing #731 - we are now correctly only collecting exported resources
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2746 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
-rwxr-xr-xtest/rails/collection.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/rails/collection.rb b/test/rails/collection.rb
index 005d4502c..d878641be 100755
--- a/test/rails/collection.rb
+++ b/test/rails/collection.rb
@@ -209,6 +209,39 @@ class TestRailsCollection < PuppetTest::TestCase
assert(ret.empty?, "Found exports from our own host")
end
+
+ # #731 -- we're collecting all resources, not just exported resources.
+ def test_only_collecting_exported_resources
+ railsinit
+
+ # Make our configuration
+ host = Puppet::Rails::Host.new(:name => "myhost")
+
+ host.resources.build(:title => "/tmp/exporttest1", :restype => "file",
+ :exported => true)
+ host.resources.build(:title => "/tmp/exporttest2", :restype => "file",
+ :exported => false)
+
+ host.save
+
+ @scope.host = "otherhost"
+
+ # Now make a collector
+ coll = nil
+ assert_nothing_raised do
+ coll = Puppet::Parser::Collector.new(@scope, "file", nil, nil, :exported)
+ end
+
+ # And make sure we get nada back
+ ret = nil
+ assert_nothing_raised do
+ ret = coll.collect_exported
+ end
+
+ names = ret.collect { |res| res.title }
+
+ assert_equal(%w{/tmp/exporttest1}, names, "Collected incorrect resource list")
+ end
end
# $Id$