From: Daniel Pittman <[email protected]>
When a new fstab fixture is added, we also want to try to test mount output.
If that fixture is missing, we would have failed a test, but now mark it
pending.
This is more correct when, for example, we don't yet have that fixture: it
isn't technically a failure, just an incomplete set of test data.
---
spec/unit/provider/mount/parsed_spec.rb | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/spec/unit/provider/mount/parsed_spec.rb
b/spec/unit/provider/mount/parsed_spec.rb
index e8a862f..43defbe 100755
--- a/spec/unit/provider/mount/parsed_spec.rb
+++ b/spec/unit/provider/mount/parsed_spec.rb
@@ -201,6 +201,14 @@ FSTAB
pending "We need to stub the operatingsystem fact at load time,
but can't"
end
+ # Stub the mount output to our fixture.
+ begin
+ mount = my_fixture(platform + '.mount')
+ @provider.stubs(:mountcmd).returns File.read(mount)
+ rescue
+ pending "is #{platform}.mount missing at this point?"
+ end
+
# Note: we have to stub default_target before creating resources
# because it is used by Puppet::Type::Mount.new to populate the
# :target property.
@@ -216,8 +224,6 @@ FSTAB
[@res_ghost, @res_mounted, @res_unmounted, @res_absent].each do
|resource|
@resource_hash[resource.name] = resource
end
-
- @provider.stubs(:mountcmd).returns File.read(my_fixture(platform +
'.mount'))
end
it "should set :ensure to :unmounted if found in fstab but not mounted"
do
--
1.7.4.1
--
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en.