summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorStefan Schulte <stefan.schulte@taunusstein.net>2011-01-30 20:34:27 +0100
committerStefan Schulte <stefan.schulte@taunusstein.net>2011-01-30 20:34:27 +0100
commitd6e4ffeb069686050b0ad1db544389be40e39b57 (patch)
tree6728f520a6da4c18a009629ecf00f0bb8f2e4518 /spec
parentf534470221fb97f2d25700f01c3f8c43aef73c26 (diff)
downloadpuppet-d6e4ffeb069686050b0ad1db544389be40e39b57.tar.gz
puppet-d6e4ffeb069686050b0ad1db544389be40e39b57.tar.xz
puppet-d6e4ffeb069686050b0ad1db544389be40e39b57.zip
(#4914) Specs for mounted? match new behaviour
The question if a filesystem is mounted or not can be answered without calling mount and the specs have to reflect that.
Diffstat (limited to 'spec')
-rwxr-xr-xspec/unit/provider/mount_spec.rb50
1 files changed, 13 insertions, 37 deletions
diff --git a/spec/unit/provider/mount_spec.rb b/spec/unit/provider/mount_spec.rb
index 232c559f4..3fc8a8664 100755
--- a/spec/unit/provider/mount_spec.rb
+++ b/spec/unit/provider/mount_spec.rb
@@ -121,50 +121,26 @@ describe Puppet::Provider::Mount do
@mounter.mounted?
end
- end
-
- describe Puppet::Provider::Mount, " when prefetching resources" do
-
- it "should match ' on /private/var/automount<name>' if the operating system is Darwin" do
- Facter.stubs(:value).with("operatingsystem").returns("Darwin")
- @mounter.expects(:mountcmd).returns("/dev/whatever on /private/var/automount/\ndevfs on /dev")
-
- @mounter.should be_mounted
+ it "should return true if prefetched value is :mounted" do
+ @mounter.stubs(:get).with(:ensure).returns(:mounted)
+ @mounter.mounted? == true
end
- it "should match ' on <name>' if the operating system is Darwin" do
- Facter.stubs(:value).with("operatingsystem").returns("Darwin")
- @mounter.expects(:mountcmd).returns("/dev/disk03 on / (local, journaled)\ndevfs on /dev")
-
- @mounter.should be_mounted
+ it "should return true if prefetched value is :ghost" do
+ @mounter.stubs(:get).with(:ensure).returns(:ghost)
+ @mounter.mounted? == true
end
- it "should match '^<name> on' if the operating system is Solaris" do
- Facter.stubs(:value).with("operatingsystem").returns("Solaris")
- @mounter.expects(:mountcmd).returns("/ on /dev/dsk/whatever\n/var on /dev/dsk/other")
-
- @mounter.should be_mounted
+ it "should return false if prefetched value is :absent" do
+ @mounter.stubs(:get).with(:ensure).returns(:absent)
+ @mounter.mounted? == false
end
- it "should match '^<name> on' if the operating system is HP-UX" do
- Facter.stubs(:value).with("operatingsystem").returns("HP-UX")
- @mounter.expects(:mountcmd).returns("/ on /dev/dsk/whatever\n/var on /dev/dsk/other")
-
- @mounter.should be_mounted
- end
-
- it "should match ' on <name>' if the operating system is not Darwin, Solaris, or HP-UX" do
- Facter.stubs(:value).with("operatingsystem").returns("Debian")
- @mounter.expects(:mountcmd).returns("/dev/dsk/whatever on / and stuff\n/dev/other/disk on /var and stuff")
-
- @mounter.should be_mounted
+ it "should return false if prefetched value is :unmounted" do
+ @mounter.stubs(:get).with(:ensure).returns(:unmounted)
+ @mounter.mounted? == false
end
- it "should not be considered mounted if it did not match the mount output" do
- Facter.stubs(:value).with("operatingsystem").returns("Debian")
- @mounter.expects(:mountcmd).returns("/dev/dsk/whatever on /something/else and stuff\n/dev/other/disk on /var and stuff")
-
- @mounter.should_not be_mounted
- end
end
+
end