summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-09-14 16:53:51 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2016-09-14 16:53:51 -0700
commitbf3941560a6a7149dda9f0aac25588a48b0d1e30 (patch)
tree89ea2b0550041aa2cb5610876e1965a4a83b8407
parent3eb0d2292bdb54709b1f88bc9335b24d2269f0b8 (diff)
downloadchef-bf3941560a6a7149dda9f0aac25588a48b0d1e30.tar.gz
add tests for provider behavior
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--spec/unit/provider/user/linux_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/unit/provider/user/linux_spec.rb b/spec/unit/provider/user/linux_spec.rb
index 2470b26e2c..1c487c0de9 100644
--- a/spec/unit/provider/user/linux_spec.rb
+++ b/spec/unit/provider/user/linux_spec.rb
@@ -77,6 +77,18 @@ describe Chef::Provider::User::Linux do
expect( @new_resource.manage_home ).to be false
end
+ it "supports[:manage_home] (incorectly) acts like manage_home" do
+ Chef::Config[:treat_deprecation_warnings_as_errors] = false
+ @new_resource.supports({ manage_home: true })
+ expect( provider.useradd_options ).to eql(["-m"])
+ end
+
+ it "supports[:manage_home] does not change behavior of manage_home: false", chef: ">= 13" do
+ Chef::Config[:treat_deprecation_warnings_as_errors] = false
+ @new_resource.supports({ manage_home: true })
+ expect( provider.useradd_options ).to eql(["-M"])
+ end
+
it "by default manage_home is false and we use -M" do
expect( provider.useradd_options ).to eql(["-M"])
end