如何测试Puppet类型的只读属性

时间:2015-02-09 15:14:26

标签: ruby rspec puppet ruby-1.8.7 rspec3

我的Puppet类型定义如下:

Puppet::Type.newtype(:my_type) do
  newproperty(:id, :readonly => true) do
    desc "Some id."
  end
end

我想问一下如何在rspecs中测试属性:id是readonly吗?

describe Puppet::Type.type(:netapp_e_volume) do
  it 'should have readonly :id attribute' do
    # this part I don't have
  end
end

1 个答案:

答案 0 :(得分:1)

As of April of 2016 this is still not possible according to this Puppet Jira Ticket

https://tickets.puppetlabs.com/browse/PUP-5624

中的所有链接

该检测仍处于未解决状态