summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-02-12 22:48:34 -0600
committerLuke Kanies <luke@madstop.com>2009-02-12 22:48:34 -0600
commit7cf085c9ebdb1d1c92e317a406844bfc0eceafe6 (patch)
tree6642a3cb4ba2c809ea27a79c61facd5c9448155c
parent70ea39af65f7e56ce151c9f9ca444261d0332454 (diff)
downloadpuppet-7cf085c9ebdb1d1c92e317a406844bfc0eceafe6.tar.gz
puppet-7cf085c9ebdb1d1c92e317a406844bfc0eceafe6.tar.xz
puppet-7cf085c9ebdb1d1c92e317a406844bfc0eceafe6.zip
Adding tests for Puppet::Indirector::Facts::Facter.loadfacts
I just copied the tests from the master branch, changed as necessary. Signed-off-by: Luke Kanies <luke@madstop.com>
-rwxr-xr-xspec/unit/indirector/facts/facter.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/spec/unit/indirector/facts/facter.rb b/spec/unit/indirector/facts/facter.rb
index 225eb153b..5dcc4442b 100755
--- a/spec/unit/indirector/facts/facter.rb
+++ b/spec/unit/indirector/facts/facter.rb
@@ -70,7 +70,14 @@ describe Puppet::Node::Facts::Facter do
end
end
- describe Puppet::Node::Facts::Facter, " when loading facts from the factpath" do
- it "should load every fact in each factpath directory"
+ describe Puppet::Node::Facts::Facter, "when loading facts from the factpath" do
+ it "should load each directory in the Fact path when loading fact" do
+ Puppet.settings.expects(:value).with(:factpath).returns("one%stwo" % File::PATH_SEPARATOR)
+
+ Puppet::Node::Facts::Facter.expects(:loaddir).with("one", "fact")
+ Puppet::Node::Facts::Facter.expects(:loaddir).with("two", "fact")
+
+ Puppet::Node::Facts::Facter.loadfacts
+ end
end
end