From dcfc1714959bf2afa2d890b36ea3faaaab29759f Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Thu, 15 May 2008 14:55:51 -0500 Subject: 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. --- spec/unit/util/loader.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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 -- cgit