diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-07-12 16:39:47 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-07-12 16:39:47 +0000 |
| commit | edb1be2d7599c12a3116a17d17d5d87e7e45b4da (patch) | |
| tree | 83af64ee23cc01a34f45143fa8d630f72b98d849 /test/ral/manager | |
| parent | f1462cb0d262ccd29b2b5cac5bec4b51e91569e8 (diff) | |
| download | puppet-edb1be2d7599c12a3116a17d17d5d87e7e45b4da.tar.gz puppet-edb1be2d7599c12a3116a17d17d5d87e7e45b4da.tar.xz puppet-edb1be2d7599c12a3116a17d17d5d87e7e45b4da.zip | |
Fixing the :check metaparam so it does not try to check unsupported parameters
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2684 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/ral/manager')
| -rwxr-xr-x | test/ral/manager/attributes.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/ral/manager/attributes.rb b/test/ral/manager/attributes.rb index 273dc6844..ef8742d48 100755 --- a/test/ral/manager/attributes.rb +++ b/test/ral/manager/attributes.rb @@ -6,6 +6,7 @@ $:.unshift("../../lib") if __FILE__ =~ /\.rb$/ require 'puppettest' +require 'mocha' class TestTypeAttributes < Test::Unit::TestCase include PuppetTest @@ -315,6 +316,37 @@ class TestTypeAttributes < Test::Unit::TestCase inst.value = :nosuchattr end end + + def test_check_ignores_unsupported_params + type = Puppet::Type.newtype(:unsupported) do + feature :nosuchfeat, "testing" + newparam(:name) {} + newproperty(:yep) {} + newproperty(:nope, :required_features => :nosuchfeat) {} + end + $yep = :absent + type.provide(:only) do + def self.supports_parameter?(param) + if param.name == :nope + return false + else + return true + end + end + + def yep + $yep + end + def yep=(v) + $yep = v + end + end + cleanup { Puppet::Type.rmtype(:unsupported) } + + obj = type.create(:name => "test", :check => :yep) + obj.expects(:newattr).with(:nope).never + obj[:check] = :all + end end # $Id$ |
