summaryrefslogtreecommitdiffstats
path: root/test/lib
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-12-23 04:49:56 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-12-23 04:49:56 +0000
commit9bb5c50d0b30b4dfb82b6b705dfcbf0e126a9d61 (patch)
treee41fbeb90e4050ea2af6d37e7b443cf9f84be162 /test/lib
parentbe711d357857f5e6d4a28a22bd60dd89e9e136c0 (diff)
downloadpuppet-9bb5c50d0b30b4dfb82b6b705dfcbf0e126a9d61.tar.gz
puppet-9bb5c50d0b30b4dfb82b6b705dfcbf0e126a9d61.tar.xz
puppet-9bb5c50d0b30b4dfb82b6b705dfcbf0e126a9d61.zip
Not downcasing facts any longer, closing #210 (although not using the patch from mpalmer, since I had not noticed the patch was there). Also, making all nodes, classes, and definitions case insensitive, closing #344. Finally, I added case insensitivity to the language in general, which should preserve backwards compatibility and probably makes the most sense in the long run anyway.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1964 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/lib')
-rwxr-xr-xtest/lib/puppettest.rb9
-rw-r--r--test/lib/puppettest/parsertesting.rb28
2 files changed, 37 insertions, 0 deletions
diff --git a/test/lib/puppettest.rb b/test/lib/puppettest.rb
index e83cc9a04..67d1a29c9 100755
--- a/test/lib/puppettest.rb
+++ b/test/lib/puppettest.rb
@@ -55,6 +55,15 @@ module PuppetTest
ENV["RUBYLIB"] = curlibs.join(":")
end
+
+ def logcollector
+ collector = []
+ Puppet::Log.newdestination(collector)
+ cleanup do
+ Puppet::Log.close(collector)
+ end
+ collector
+ end
def rake?
$0 =~ /rake_test_loader/
diff --git a/test/lib/puppettest/parsertesting.rb b/test/lib/puppettest/parsertesting.rb
index c7d4ec961..f71ba6b82 100644
--- a/test/lib/puppettest/parsertesting.rb
+++ b/test/lib/puppettest/parsertesting.rb
@@ -5,6 +5,34 @@ module PuppetTest::ParserTesting
include PuppetTest
AST = Puppet::Parser::AST
+ # A fake class that we can use for testing evaluation.
+ class FakeAST
+ attr_writer :evaluate
+
+ def evaluated?
+ defined? @evaluated and @evaluated
+ end
+
+ def evaluate(*args)
+ @evaluated = true
+ return @evaluate
+ end
+
+ def initialize(val = nil)
+ if val
+ @evaluate = val
+ end
+ end
+
+ def reset
+ @evaluated = nil
+ end
+
+ def safeevaluate(*args)
+ evaluate()
+ end
+ end
+
def astarray(*args)
AST::ASTArray.new(
:children => args