diff options
| author | Jeffrey McCune <mccune.jeff@gmail.com> | 2008-11-28 22:39:22 -0500 |
|---|---|---|
| committer | James Turnbull <james@lovedthanlost.net> | 2008-12-01 18:05:06 +1100 |
| commit | 9329c95d6fbb2df5e8b754620427645f6eae69b9 (patch) | |
| tree | 5694255e239a405e9418be9dce4166afc354053d /spec/unit/provider/mcx | |
| parent | 83b3a1ec2a98edeab12a5eb9c4b107a6fe08613c (diff) | |
| download | puppet-9329c95d6fbb2df5e8b754620427645f6eae69b9.tar.gz puppet-9329c95d6fbb2df5e8b754620427645f6eae69b9.tar.xz puppet-9329c95d6fbb2df5e8b754620427645f6eae69b9.zip | |
type/mcx.rb Feature #1026 - MCX Type
Added new MCX type and base test.
This type manages MCX settings on DirectoryService nodes. These
settings take the form of plist XML documents attached to Users,
Groups, and Computers in DirectoryService.
Diffstat (limited to 'spec/unit/provider/mcx')
| -rwxr-xr-x | spec/unit/provider/mcx/mcxcontent.rb | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/spec/unit/provider/mcx/mcxcontent.rb b/spec/unit/provider/mcx/mcxcontent.rb new file mode 100755 index 000000000..6cb3fc78e --- /dev/null +++ b/spec/unit/provider/mcx/mcxcontent.rb @@ -0,0 +1,68 @@ +#! /usr/bin/env ruby +#-- +# Copyright (C) 2008 Jeffrey J McCune. + +# This program and entire repository is free software; you can +# redistribute it and/or modify it under the terms of the GNU +# General Public License as published by the Free Software +# Foundation; either version 2 of the License, or any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# Author: Jeff McCune <mccune.jeff@gmail.com> + +require File.dirname(__FILE__) + '/../../../spec_helper' + +provider_class = Puppet::Type.type(:mcx).provider(:mcxcontent) + +describe provider_class do + + before :each do + # Create a mock resource + @resource = stub 'resource' + + @provider = provider_class.new + @attached_to = "/Users/katie" + + # A catch all; no parameters set + @resource.stubs(:[]).returns(nil) + + # But set name, ensure and enable + @resource.stubs(:[]).with(:name).returns @attached_to + @resource.stubs(:[]).with(:enable).returns :true + @resource.stubs(:ref).returns "Mcx[#{@attached_to}]" + + # stub out the provider methods that actually touch the filesystem + # or execute commands + @provider.stubs(:execute).returns("") + @provider.stubs(:resource).returns @resource + end + + it "should have a create method." do + @provider.should respond_to(:create) + end + + it "should have a destroy method." do + @provider.should respond_to(:destroy) + end + + it "should have an exists? method." do + @provider.should respond_to(:exists?) + end + + it "should have an content method." do + @provider.should respond_to(:content) + end + + it "should have an content= method." do + @provider.should respond_to(:content=) + end + +end |
