summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2010-09-13 18:11:31 -0700
committerJames Turnbull <james@lovedthanlost.net>2010-09-14 11:39:08 +1000
commit14f871d6a9cad5c3eda10da005a97ed8aba9e991 (patch)
treeef6117c091384edc270d2915f60ad87ac89bb363 /spec
parent9bdfe694bc6c60a48b45f8dd49c20c6da31445f7 (diff)
downloadpuppet-14f871d6a9cad5c3eda10da005a97ed8aba9e991.tar.gz
puppet-14f871d6a9cad5c3eda10da005a97ed8aba9e991.tar.xz
puppet-14f871d6a9cad5c3eda10da005a97ed8aba9e991.zip
[#4756] addendum for #4756
This fixes spec and unit tests indirectly related to the previous patch-revert. One failure was from trying to test the User Type's roles, when, on many platforms, the roles feature wasn't supported by the default Provider. Other tests could fail on some platforms because they assumed that unsupported attributes would be ignored with a warning, but the code was crashing instead.
Diffstat (limited to 'spec')
-rwxr-xr-xspec/unit/type/user_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/unit/type/user_spec.rb b/spec/unit/type/user_spec.rb
index abe18933f..4c6eb1150 100755
--- a/spec/unit/type/user_spec.rb
+++ b/spec/unit/type/user_spec.rb
@@ -262,6 +262,11 @@ describe user do
end
describe "when user has roles" do
+ before do
+ # To test this feature, we have to support it.
+ user.new(:name => "foo").provider.class.stubs(:feature?).returns(true)
+ end
+
it "should autorequire roles" do
testuser = Puppet::Type.type(:user).new(:name => "testuser")
testuser[:roles] = "testrole"