diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/certmgr/support.rb | 3 | ||||
-rwxr-xr-x | test/language/parser.rb | 12 | ||||
-rwxr-xr-x | test/lib/puppettest.rb | 4 |
3 files changed, 10 insertions, 9 deletions
diff --git a/test/certmgr/support.rb b/test/certmgr/support.rb index 3138c94d7..060c458d8 100755 --- a/test/certmgr/support.rb +++ b/test/certmgr/support.rb @@ -89,8 +89,9 @@ class TestCertSupport < Test::Unit::TestCase should_path = Puppet[:hostprivkey] dir, file = File.split(should_path) - newfile = file.sub(/^([a-z.]+)\./) { $1.upcase + "."} + newfile = file.sub(/^([-a-z.0-9]+)\./) { $1.upcase + "."} upper_path = File.join(dir, newfile) +p upper_path File.open(upper_path, "w") { |f| f.print key.to_s } user = CertUser.new diff --git a/test/language/parser.rb b/test/language/parser.rb index 5a433c724..8cda8eeb2 100755 --- a/test/language/parser.rb +++ b/test/language/parser.rb @@ -97,7 +97,7 @@ class TestParser < Test::Unit::TestCase } 4.times { |i| - path = File.join(basedir, subdir, "subfile#{i}") + path = File.join(basedir, subdir, "subfile#{i}.pp") mkmanifest(path) } @@ -137,8 +137,8 @@ class TestParser < Test::Unit::TestCase end def test_importedclasses - imported = tempfile - importer = tempfile + imported = tempfile '.pp' + importer = tempfile '.pp' made = tempfile @@ -655,9 +655,9 @@ file { "/tmp/yayness": end def test_multiple_imports_on_one_line - one = tempfile - two = tempfile - base = tempfile + one = tempfile '.pp' + two = tempfile '.pp' + base = tempfile '.pp' File.open(one, "w") { |f| f.puts "$var = value" } File.open(two, "w") { |f| f.puts "$var = value" } File.open(base, "w") { |f| f.puts "import '#{one}', '#{two}'" } diff --git a/test/lib/puppettest.rb b/test/lib/puppettest.rb index e31a31902..294d0ef8d 100755 --- a/test/lib/puppettest.rb +++ b/test/lib/puppettest.rb @@ -227,14 +227,14 @@ module PuppetTest #Facter.stubs(:to_hash).returns({}) end - def tempfile + def tempfile(suffix = '') if defined?(@@tmpfilenum) @@tmpfilenum += 1 else @@tmpfilenum = 1 end - f = File.join(self.tmpdir, "tempfile_" + @@tmpfilenum.to_s) + f = File.join(self.tmpdir, "tempfile_" + @@tmpfilenum.to_s + suffix) @@tmpfiles ||= [] @@tmpfiles << f f |