summaryrefslogtreecommitdiffstats
path: root/test/util
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-12-18 10:57:59 -0600
committerLuke Kanies <luke@madstop.com>2008-12-18 11:10:26 -0600
commit0fc067449a5e6f4941e2dfe232383b94f163b110 (patch)
tree7ee4b5fd9d901f742b85ba8bd394f1b2eea5ae5c /test/util
parente4ba3db1963081eacc2aef3d865f777b427ef23c (diff)
downloadpuppet-0fc067449a5e6f4941e2dfe232383b94f163b110.tar.gz
puppet-0fc067449a5e6f4941e2dfe232383b94f163b110.tar.xz
puppet-0fc067449a5e6f4941e2dfe232383b94f163b110.zip
Fixing all of the test/ tests I broke in previous dev.
Most of these are straightforward changes to the tests, but a couple required small refactorings (e.g., References can now be created with Puppet::Type instances, and they know how to extract the type/title from them). Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'test/util')
-rwxr-xr-xtest/util/settings.rb85
1 files changed, 0 insertions, 85 deletions
diff --git a/test/util/settings.rb b/test/util/settings.rb
index 286b14800..c4096f0bc 100755
--- a/test/util/settings.rb
+++ b/test/util/settings.rb
@@ -468,91 +468,6 @@ yay = /a/path
assert_equal(should, result, "Add args functional test failed")
end
- def test_usesection
- # We want to make sure that config processes do not result in graphing.
- Puppet[:graphdir] = tempfile()
- Puppet[:graph] = true
- Dir.mkdir(Puppet[:graphdir])
- c = mkconfig
-
- dir = tempfile()
- file = "$mydir/myfile"
- realfile = File.join(dir, "myfile")
- otherfile = File.join(dir, "otherfile")
- section = "testing"
- assert_nothing_raised {
- @config.setdefaults(section,
- :mydir => [dir, "A dir arg"],
- :otherfile => {
- :default => "$mydir/otherfile",
- :create => true,
- :desc => "A file arg"
- },
- :myfile => [file, "A file arg"]
- )
- }
-
- assert_nothing_raised("Could not use a section") {
- @config.use(section)
- }
-
- assert_nothing_raised("Could not reuse a section") {
- @config.use(section)
- }
-
- # Make sure it didn't graph anything, which is the only real way
- # to test that the transaction was marked as a configurator.
- assert(Dir.entries(Puppet[:graphdir]).reject { |f| f =~ /^\.\.?$/ }.empty?, "Graphed config process")
-
- assert(FileTest.directory?(dir), "Did not create directory")
- assert(FileTest.exists?(otherfile), "Did not create file")
- assert(!FileTest.exists?(realfile), "Created file")
- end
-
- def test_setdefaultsarray
- c = mkconfig
-
- assert_nothing_raised {
- @config.setdefaults("yay",
- :a => [false, "some value"],
- :b => ["/my/file", "a file"]
- )
- }
-
- assert_equal(false, @config[:a], "Values are not equal")
- assert_equal("/my/file", @config[:b], "Values are not equal")
- end
-
- def test_setdefaultshash
- c = mkconfig
-
- assert_nothing_raised {
- @config.setdefaults("yay",
- :a => {:default => false, :desc => "some value"},
- :b => {:default => "/my/file", :desc => "a file"}
- )
- }
-
- assert_equal(false, @config[:a], "Values are not equal")
- assert_equal("/my/file", @config[:b], "Values are not equal")
- end
-
- def test_notmanagingdev
- c = mkconfig
- path = "/dev/testing"
- @config.setdefaults(:test,
- :file => {
- :default => path,
- :mode => 0640,
- :desc => 'yay'
- }
- )
-
- config = @config.to_catalog
-
- assert(! config.resource(:file, "/dev/testing"), "Created dev file")
- end
-
def test_groupsetting
cfile = tempfile()