diff options
author | Luke Kanies <luke@madstop.com> | 2007-10-05 11:46:35 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2007-10-05 11:46:35 -0500 |
commit | 9c58c476c2ffcf9613f14e5881b1177f01d413a7 (patch) | |
tree | 8791274ce754f486f039ba942e3a5d3d9939df3e /test/language | |
parent | d35cd947c82ba9da8ec798100a3c710c34492521 (diff) | |
download | puppet-9c58c476c2ffcf9613f14e5881b1177f01d413a7.tar.gz puppet-9c58c476c2ffcf9613f14e5881b1177f01d413a7.tar.xz puppet-9c58c476c2ffcf9613f14e5881b1177f01d413a7.zip |
Adding a :code setting for specifying code to run
instead of a manifest, and removing all of the ambiguity
around whether an interpreter gets its own file specified
or uses the central setting.
Most of the changes are around fixing existing tests to use this new system.
Diffstat (limited to 'test/language')
-rwxr-xr-x | test/language/functions.rb | 10 | ||||
-rwxr-xr-x | test/language/parser.rb | 3 | ||||
-rwxr-xr-x | test/language/scope.rb | 11 |
3 files changed, 6 insertions, 18 deletions
diff --git a/test/language/functions.rb b/test/language/functions.rb index 2a392e01a..db107fd36 100755 --- a/test/language/functions.rb +++ b/test/language/functions.rb @@ -202,16 +202,10 @@ class TestLangFunctions < Test::Unit::TestCase f.puts "original text" end - manifest = tempfile() file = tempfile() - File.open(manifest, "w") do |f| - f.puts %{file { "#{file}": content => template("#{template}") }} - end - interp = Puppet::Parser::Interpreter.new( - :Manifest => manifest, - :UseNodes => false - ) + Puppet[:code] = %{file { "#{file}": content => template("#{template}") }} + interp = Puppet::Parser::Interpreter.new node = mknode node.stubs(:environment).returns("yay") diff --git a/test/language/parser.rb b/test/language/parser.rb index 9109686cb..1e7adb45e 100755 --- a/test/language/parser.rb +++ b/test/language/parser.rb @@ -618,7 +618,8 @@ file { "/tmp/yayness": f.puts "file { '#{file}': ensure => present }" end - interp = mkinterp :Manifest => top, :UseNodes => false + Puppet[:manifest] = top + interp = Puppet::Parser::Interpreter.new code = nil assert_nothing_raised do diff --git a/test/language/scope.rb b/test/language/scope.rb index b4db5ef40..22734a5fb 100755 --- a/test/language/scope.rb +++ b/test/language/scope.rb @@ -399,24 +399,17 @@ class TestScope < Test::Unit::TestCase Puppet::Rails.init sleep 1 children = [] - file = tempfile() - File.open(file, "w") { |f| - f.puts " + Puppet[:code] = " class yay { @@host { myhost: ip => \"192.168.0.2\" } } include yay @@host { puppet: ip => \"192.168.0.3\" } Host <<||>>" - } interp = nil assert_nothing_raised { - interp = Puppet::Parser::Interpreter.new( - :Manifest => file, - :UseNodes => false, - :ForkSave => false - ) + interp = Puppet::Parser::Interpreter.new } config = nil |