diff options
| author | Luke Kanies <luke@madstop.com> | 2009-01-22 16:51:02 -0600 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2009-02-06 18:08:41 -0600 |
| commit | e65d7f11dd95ab5432adefeabc3179e9eb5dd050 (patch) | |
| tree | 52ad7eabbe7b07d5f7496587e40019cbe4e3a76e /spec/unit/agent | |
| parent | 6b4e5f49a8d1d062aefae31a923cff9e3f0d31ba (diff) | |
| download | puppet-e65d7f11dd95ab5432adefeabc3179e9eb5dd050.tar.gz puppet-e65d7f11dd95ab5432adefeabc3179e9eb5dd050.tar.xz puppet-e65d7f11dd95ab5432adefeabc3179e9eb5dd050.zip | |
Refactoring how the Facter integration works
I moved all of the extra Fact modifications into the Facts
class, and then moved the calls of those new methods
into the Facter terminus.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec/unit/agent')
| -rwxr-xr-x | spec/unit/agent/fact_handler.rb | 31 |
1 files changed, 2 insertions, 29 deletions
diff --git a/spec/unit/agent/fact_handler.rb b/spec/unit/agent/fact_handler.rb index b58f55ebc..9622b0649 100755 --- a/spec/unit/agent/fact_handler.rb +++ b/spec/unit/agent/fact_handler.rb @@ -82,36 +82,9 @@ describe Puppet::Agent::FactHandler do @facthandler.reload_facter end - it "should load all Puppet Fact plugins" do - @facthandler.expects(:load_fact_plugins) + it "should use the Facter terminus load all Puppet Fact plugins" do + Puppet::Node::Facts::Facter.expects(:load_fact_plugins) @facthandler.reload_facter end end - - it "should load each directory in the Fact path when loading fact plugins" do - Puppet.settings.expects(:value).with(:factpath).returns("one%stwo" % File::PATH_SEPARATOR) - - @facthandler.expects(:load_facts_in_dir).with("one") - @facthandler.expects(:load_facts_in_dir).with("two") - - @facthandler.load_fact_plugins - end - - it "should skip files when asked to load a directory" do - FileTest.expects(:directory?).with("myfile").returns false - - @facthandler.load_facts_in_dir("myfile") - end - - it "should load each ruby file when asked to load a directory" do - FileTest.expects(:directory?).with("mydir").returns true - Dir.expects(:chdir).with("mydir").yields - - Dir.expects(:glob).with("*.rb").returns %w{a.rb b.rb} - - @facthandler.expects(:load).with("a.rb") - @facthandler.expects(:load).with("b.rb") - - @facthandler.load_facts_in_dir("mydir") - end end |
