summaryrefslogtreecommitdiffstats
path: root/test/language/interpreter.rb
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-10-05 19:24:44 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-10-05 19:24:44 +0000
commit06a7d345bef7a41cb6320e14a1dd9476505fd65f (patch)
tree7a30b6db252c332321d5f52a1d5b0e9ca9064831 /test/language/interpreter.rb
parent2489764b12031f20022d08e662ee3fa826a75b95 (diff)
downloadpuppet-06a7d345bef7a41cb6320e14a1dd9476505fd65f.tar.gz
puppet-06a7d345bef7a41cb6320e14a1dd9476505fd65f.tar.xz
puppet-06a7d345bef7a41cb6320e14a1dd9476505fd65f.zip
Fixing ldap nodes -- they were always returning true because i was returning an empty array for missing nodes.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1733 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/language/interpreter.rb')
-rwxr-xr-xtest/language/interpreter.rb18
1 files changed, 17 insertions, 1 deletions
diff --git a/test/language/interpreter.rb b/test/language/interpreter.rb
index e195e28b3..755a07aa8 100755
--- a/test/language/interpreter.rb
+++ b/test/language/interpreter.rb
@@ -151,9 +151,17 @@ class TestInterpreter < Test::Unit::TestCase
interp = mkinterp :NodeSources => [:ldap, :code]
- # Make sure we can find 'culain' in ldap
+ # Make sure we get nil and nil back when we search for something missing
parent, classes = nil
assert_nothing_raised do
+ parent, classes = interp.ldapsearch("nosuchhost")
+ end
+
+ assert_nil(parent, "Got a parent for a non-existent host")
+ assert_nil(classes, "Got classes for a non-existent host")
+
+ # Make sure we can find 'culain' in ldap
+ assert_nothing_raised do
parent, classes = interp.ldapsearch("culain")
end
@@ -173,6 +181,14 @@ class TestInterpreter < Test::Unit::TestCase
# culain uses basenode, so create that
basenode = interp.newnode([:basenode])[0]
+ # Make sure we get nothing for nonexistent hosts
+ none = nil
+ assert_nothing_raised do
+ none = interp.nodesearch_ldap("nosuchhost")
+ end
+
+ assert_nil(none, "Got a node for a non-existent host")
+
# Make sure we can find 'culain' in ldap
culain = nil
assert_nothing_raised do