summaryrefslogtreecommitdiffstats
path: root/test/language
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2005-08-24 02:53:17 +0000
committerLuke Kanies <luke@madstop.com>2005-08-24 02:53:17 +0000
commit386ebee31dcc67ac5a7fb569ee58c2365e0666e1 (patch)
tree78db9c5928457c23907f87a2d105185bb6664e51 /test/language
parent583a9c6e2a7469e4ae3b72264010a5d8d0dab867 (diff)
replacing if statements with case statement, and adding defaults for both selectors and case statements
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@587 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/language')
-rwxr-xr-xtest/language/tc_snippets.rb30
1 files changed, 27 insertions, 3 deletions
diff --git a/test/language/tc_snippets.rb b/test/language/tc_snippets.rb
index b207d8a92..338755575 100755
--- a/test/language/tc_snippets.rb
+++ b/test/language/tc_snippets.rb
@@ -267,6 +267,23 @@ class TestSnippets < Test::Unit::TestCase
assert(File.stat(file2).mode & 007777 == 0644)
end
+ def snippet_casestatement(trans)
+ files = %w{
+ /tmp/existsfile
+ /tmp/existsfile2
+ /tmp/existsfile3
+ }
+
+ files.each { |file|
+ assert(FileTest.exists?(file), "File %s is missing" % file)
+ assert(File.stat(file).mode & 007777 == 0755, "File %s is not 755" % file)
+ }
+
+ assert_nothing_raised {
+ trans.rollback
+ }
+ end
+
def disabled_snippet_dirchmod(trans)
dirs = %w{a b}.collect { |letter|
"/tmp/dirchmodtest%s" % letter
@@ -306,9 +323,16 @@ class TestSnippets < Test::Unit::TestCase
)
assert(client.local)
- client.getconfig()
- trans = client.config()
- self.send(mname, trans)
+ assert_nothing_raised {
+ client.getconfig()
+ }
+ trans = nil
+ assert_nothing_raised {
+ trans = client.config()
+ }
+ assert_nothing_raised {
+ self.send(mname, trans)
+ }
}
mname = mname.intern
#eval("alias %s %s" % [testname, mname])