diff options
author | Luke Kanies <luke@madstop.com> | 2008-05-15 14:55:51 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-05-15 14:55:51 -0500 |
commit | dcfc1714959bf2afa2d890b36ea3faaaab29759f (patch) | |
tree | 7f8b7867db6ff989ead4f788931ac98e5fbf205d | |
parent | 1ba2bed578debd251d2b9514039082eaa3f136df (diff) | |
download | facter-dcfc1714959bf2afa2d890b36ea3faaaab29759f.tar.gz facter-dcfc1714959bf2afa2d890b36ea3faaaab29759f.tar.xz facter-dcfc1714959bf2afa2d890b36ea3faaaab29759f.zip |
Fixing the test so it doesn't break other tests.
It creates a constant that affects loader behaviour,
which causes other tests to break if the constant is
present but not functional.
-rwxr-xr-x | spec/unit/util/loader.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/unit/util/loader.rb b/spec/unit/util/loader.rb index 4c0d777..e6a7f17 100755 --- a/spec/unit/util/loader.rb +++ b/spec/unit/util/loader.rb @@ -7,7 +7,19 @@ require 'facter/util/loader' # Make sure we have a Puppet constant, so we can test # loading Puppet facts. unless defined?(Puppet) - class Puppet; end + class Puppet + # We have to implement this, because other tests will + # see this constant and fail if this method doesn't exist. + # I couldn't find a way to add and remove the constant + # just for the correct tests. + def self.settings + s = Object.new + def s.value(arg) + return "/eh" + end + s + end + end end describe Facter::Util::Loader do |