diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-12-20 19:41:38 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-12-20 19:41:38 +0000 |
| commit | 299bdc1b23bbf39e436f5e67b598d60606ca6513 (patch) | |
| tree | 26f5d2ae6807a6e2fae1f4aa8f58f56883042333 /test/util | |
| parent | e605c4aadd3a3c4cccbd01661c21a715ec3f0773 (diff) | |
| download | puppet-299bdc1b23bbf39e436f5e67b598d60606ca6513.tar.gz puppet-299bdc1b23bbf39e436f5e67b598d60606ca6513.tar.xz puppet-299bdc1b23bbf39e436f5e67b598d60606ca6513.zip | |
Fixing #380. The problem was that a method was sometimes returning :absent when I expected it to return nil when the group was not found. All fixed, yay.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1960 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/util')
| -rwxr-xr-x | test/util/utiltest.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/util/utiltest.rb b/test/util/utiltest.rb index 74a29d56f..3f2532fc2 100755 --- a/test/util/utiltest.rb +++ b/test/util/utiltest.rb @@ -307,6 +307,25 @@ class TestPuppetUtil < Test::Unit::TestCase # assert_equal(group.gid, File.stat(file).gid, "gid was not set correctly") end end + + # This is mostly to test #380. + def test_get_provider_value + group = Puppet::Type.type(:group).create :name => "yayness", :ensure => :present + + root = Puppet::Type.type(:user).create :name => "root", :ensure => :present + + val = nil + assert_nothing_raised do + val = Puppet::Util.get_provider_value(:group, :gid, "yayness") + end + assert_nil(val, "returned a value on a missing group") + + # Now make sure we get a value for one we know exists + assert_nothing_raised do + val = Puppet::Util.get_provider_value(:user, :uid, "root") + end + assert_equal(0, val, "got invalid uid for root") + end end # $Id$ |
