summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-09-21 15:47:27 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-09-21 15:47:27 +0000
commit2b27289b599047335fb2d63c6f2248125c74aae9 (patch)
tree4be4bfc4e6b0cc821235771e08641df69d1d35c2 /test
parent0870c5c910271bd7b915ecd566721e8077a11bd4 (diff)
downloadpuppet-2b27289b599047335fb2d63c6f2248125c74aae9.tar.gz
puppet-2b27289b599047335fb2d63c6f2248125c74aae9.tar.xz
puppet-2b27289b599047335fb2d63c6f2248125c74aae9.zip
Fixing #293, I think. The problem was that the groups state was not correctly passing strings in all cases, which caused some very strange problems internally.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1640 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
-rwxr-xr-xtest/types/user.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/types/user.rb b/test/types/user.rb
index 958cf9441..703004f57 100755
--- a/test/types/user.rb
+++ b/test/types/user.rb
@@ -283,6 +283,8 @@ class TestUser < Test::Unit::TestCase
user.retrieve
}
+ assert_instance_of(String, user.state(:groups).should)
+
# Some tests to verify that groups work correctly startig from nothing
# Remove our user
user[:ensure] = :absent
@@ -312,7 +314,7 @@ class TestUser < Test::Unit::TestCase
user[:groups] = main
}
- assert_equal((main + extra).sort, user.state(:groups).should.sort)
+ assert_equal((main + extra).sort, user.state(:groups).should.split(",").sort)
assert_nothing_raised {
user.retrieve
@@ -348,6 +350,12 @@ class TestUser < Test::Unit::TestCase
list = user.state(:groups).is
assert_equal(main.sort, list.sort, "Group list is not equal")
+ # Set the values a bit differently.
+ user.state(:groups).should = list.sort { |a,b| b <=> a }
+ user.state(:groups).is = list.sort
+
+ assert(user.state(:groups).insync?, "Groups state did not sort groups")
+
user.delete(:groups)
end