summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/language/ast.rb6
-rwxr-xr-xtest/language/scope.rb2
-rwxr-xr-xtest/other/config.rb3
-rw-r--r--test/other/transactions.rb1
-rw-r--r--test/parser/parser.rb4
-rwxr-xr-xtest/puppet/conffiles.rb16
6 files changed, 18 insertions, 14 deletions
diff --git a/test/language/ast.rb b/test/language/ast.rb
index 3dc5fd582..b5497eb0d 100755
--- a/test/language/ast.rb
+++ b/test/language/ast.rb
@@ -172,6 +172,10 @@ class TestAST < Test::Unit::TestCase
scope = nil
assert_nothing_raised("Could not evaluate node") {
scope = Puppet::Parser::Scope.new()
+ scope.name = "nodetest"
+ scope.type = "nodetest"
+ scope.keyword = "nodetest"
+ scope.top = true
top.evaluate(scope)
}
@@ -339,7 +343,7 @@ class TestAST < Test::Unit::TestCase
end
# Test that node inheritance works correctly
- def test_znodeinheritance
+ def test_nodeinheritance
children = []
# create the base node
diff --git a/test/language/scope.rb b/test/language/scope.rb
index 67792daae..707372d1a 100755
--- a/test/language/scope.rb
+++ b/test/language/scope.rb
@@ -396,6 +396,8 @@ class TestScope < Test::Unit::TestCase
scope = nil
assert_nothing_raised("Could not evaluate") {
scope = Puppet::Parser::Scope.new()
+ scope.name = "topscope"
+ scope.type = "topscope"
objects = scope.evaluate(top)
}
diff --git a/test/other/config.rb b/test/other/config.rb
index 849fa1c97..298480484 100755
--- a/test/other/config.rb
+++ b/test/other/config.rb
@@ -137,6 +137,7 @@ yay = /a/path
assert_equal("value", c[:attr])
assert_equal("/some/dir", c[:attr2])
+ assert_equal(:directory, c.element(:attr2).type)
assert_equal("/some/dir/other", c[:attr3])
elem = nil
@@ -146,8 +147,6 @@ yay = /a/path
assert(elem)
assert_equal("puppet", elem.user)
-
- puts c.to_manifest
end
end
diff --git a/test/other/transactions.rb b/test/other/transactions.rb
index ed6843104..862a28b85 100644
--- a/test/other/transactions.rb
+++ b/test/other/transactions.rb
@@ -124,6 +124,7 @@ class TestTransactions < Test::Unit::TestCase
file[:mode] = "755"
}
trans = assert_events([:file_changed, :file_changed], component)
+ file.retrieve
assert_rollback_events(trans, [:file_changed, :file_changed], "file")
diff --git a/test/parser/parser.rb b/test/parser/parser.rb
index 68209a0d2..13b8a2e85 100644
--- a/test/parser/parser.rb
+++ b/test/parser/parser.rb
@@ -95,7 +95,7 @@ class TestParser < Test::Unit::TestCase
}
end
- def test_zdefaults
+ def test_defaults
basedir = File.join(tmpdir(), "defaulttesting")
@@tmpfiles << basedir
Dir.mkdir(basedir)
@@ -151,6 +151,8 @@ class TestParser < Test::Unit::TestCase
scope = nil
assert_nothing_raised("Could not evaluate defaults parse tree") {
scope = Puppet::Parser::Scope.new()
+ scope.name = "parsetest"
+ scope.type = "parsetest"
objects = scope.evaluate(ast)
}
diff --git a/test/puppet/conffiles.rb b/test/puppet/conffiles.rb
index f966322f7..49da5fa46 100755
--- a/test/puppet/conffiles.rb
+++ b/test/puppet/conffiles.rb
@@ -27,11 +27,6 @@ class TestConfFiles < Test::Unit::TestCase
"boo" => {
"eb" => "fb"
},
- "rah" => {
- "aa" => "this is a sentence",
- "ca" => "dk",
- "ea" => "fk"
- },
},
{
"puppet" => {
@@ -41,7 +36,7 @@ class TestConfFiles < Test::Unit::TestCase
"okay" => "rah"
},
"back" => {
- "okay" => "rah"
+ "yayness" => "rah"
},
}
]
@@ -54,7 +49,7 @@ class TestConfFiles < Test::Unit::TestCase
data = data.dup
str += "[puppet]\n"
data["puppet"].each { |var, value|
- str += "%s %s\n" % [var, value]
+ str += "%s = %s\n" % [var, value]
}
data.delete("puppet")
end
@@ -62,7 +57,7 @@ class TestConfFiles < Test::Unit::TestCase
data.each { |type, settings|
str += "[%s]\n" % type
settings.each { |var, value|
- str += "%s %s\n" % [var, value]
+ str += "%s = %s\n" % [var, value]
}
}
@@ -85,14 +80,15 @@ class TestConfFiles < Test::Unit::TestCase
File.open(path, "w") { |f| f.print data2config(data) }
config = nil
assert_nothing_raised {
- config = Puppet::Config.new(path)
+ config = Puppet::Config.new
+ config.parse(path)
}
data.each { |section, hash|
hash.each { |var, value|
assert_equal(
data[section][var],
- config[section][var],
+ config[var],
"Got different values at %s/%s" % [section, var]
)
}