summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMukta A <mukta.aphale@clogeny.com>2013-06-10 13:54:04 +0530
committeradamedx <adamed@opscode.com>2013-06-11 09:37:52 -0700
commitcf544bddcb960c77cf7a8fd0cfd3811e89ab14a0 (patch)
treed81134807b5503c6b925ad23d09fe6e553327c8c
parent8ff116e564402e7521414a5cad34e21cf7ef022f (diff)
downloadchef-cf544bddcb960c77cf7a8fd0cfd3811e89ab14a0.tar.gz
Added tests for mount - to support username, password and domain
-rw-r--r--spec/unit/resource/mount_spec.rb37
1 files changed, 37 insertions, 0 deletions
diff --git a/spec/unit/resource/mount_spec.rb b/spec/unit/resource/mount_spec.rb
index 498f33a7ba..9f9a534a4e 100644
--- a/spec/unit/resource/mount_spec.rb
+++ b/spec/unit/resource/mount_spec.rb
@@ -136,6 +136,21 @@ describe Chef::Resource::Mount do
@resource.supports.should == support_hash
end
+ it "should allow you to set username" do
+ @resource.username("Administrator")
+ @resource.username.should == "Administrator"
+ end
+
+ it "should allow you to set password" do
+ @resource.password("Jetstream123!")
+ @resource.password.should == "Jetstream123!"
+ end
+
+ it "should allow you to set domain" do
+ @resource.domain("TEST_DOMAIN")
+ @resource.domain.should == "TEST_DOMAIN"
+ end
+
describe "when it has mount point, device type, and fstype" do
before do
@resource.device("charmander")
@@ -155,4 +170,26 @@ describe Chef::Resource::Mount do
@resource.identity.should == "charmander"
end
end
+
+ describe "when it has username, password and domain" do
+ before do
+ @resource.mount_point("T:")
+ @resource.device("charmander")
+ @resource.username("Administrator")
+ @resource.password("Jetstream123!")
+ @resource.domain("TEST_DOMAIN")
+ end
+
+ it "describes its state" do
+ state = @resource.state
+ puts state
+ state[:mount_point].should == "T:"
+ state[:username].should == "Administrator"
+ state[:password].should == "Jetstream123!"
+ state[:domain].should == "TEST_DOMAIN"
+ state[:device_type].should eql(:device)
+ state[:fstype].should == "auto"
+ end
+
+ end
end