[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 2.6.5-303-gfcfa26a
Stefan Schulte
stefan.schulte at taunusstein.net
Thu Mar 17 10:46:09 UTC 2011
The following commit has been merged in the upstream branch:
commit d6e4ffeb069686050b0ad1db544389be40e39b57
Author: Stefan Schulte <stefan.schulte at taunusstein.net>
Date: Sun Jan 30 20:34:27 2011 +0100
(#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.
diff --git a/spec/unit/provider/mount_spec.rb b/spec/unit/provider/mount_spec.rb
index 232c559..3fc8a86 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
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list