diff options
author | Stefan Schulte <stefan.schulte@taunusstein.net> | 2010-12-23 22:11:49 +0100 |
---|---|---|
committer | Stefan Schulte <stefan.schulte@taunusstein.net> | 2010-12-23 22:11:49 +0100 |
commit | 8b98526b0f81d559fdf85fc8aaf370f75baa5919 (patch) | |
tree | 2f7b6e6fb8cf9f773eb49427eb93c20de41eb03b /spec | |
parent | 2a0c970b8f91c9687d3f2a1dea5adac44b5f96fb (diff) | |
download | puppet-8b98526b0f81d559fdf85fc8aaf370f75baa5919.tar.gz puppet-8b98526b0f81d559fdf85fc8aaf370f75baa5919.tar.xz puppet-8b98526b0f81d559fdf85fc8aaf370f75baa5919.zip |
(#5662) Fixed tests that didnt stub key_attributes
The parsedfile provider calls the method key_attributes of the resource
class to decide what resourceparameters must be put in the
property_hash. Tests that uses fake resources and only stub
resource[:name] must also stub resource.class.key_attributes
Diffstat (limited to 'spec')
-rwxr-xr-x | spec/unit/provider/mount/parsed_spec.rb | 1 | ||||
-rwxr-xr-x | spec/unit/provider/ssh_authorized_key/parsed_spec.rb | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/spec/unit/provider/mount/parsed_spec.rb b/spec/unit/provider/mount/parsed_spec.rb index 7d2e8a84c..3d37fc72e 100755 --- a/spec/unit/provider/mount/parsed_spec.rb +++ b/spec/unit/provider/mount/parsed_spec.rb @@ -51,6 +51,7 @@ module ParsedMountTesting #hash[:provider] = @provider_class.name fakeresource = stub :type => :mount, :name => hash[:name] + fakeresource.class.stubs(:key_attributes).returns([:name]) fakeresource.stubs(:[]).with(:name).returns(hash[:name]) fakeresource.stubs(:should).with(:target).returns(nil) diff --git a/spec/unit/provider/ssh_authorized_key/parsed_spec.rb b/spec/unit/provider/ssh_authorized_key/parsed_spec.rb index 11e9233e0..2e5be165a 100755 --- a/spec/unit/provider/ssh_authorized_key/parsed_spec.rb +++ b/spec/unit/provider/ssh_authorized_key/parsed_spec.rb @@ -104,6 +104,7 @@ describe provider_class do before :each do @resource = stub("resource", :name => "foo") @resource.stubs(:[]).returns "foo" + @resource.class.stubs(:key_attributes).returns( [:name] ) @provider = provider_class.new(@resource) provider_class.stubs(:filetype).returns(Puppet::Util::FileType::FileTypeRam) |