我正在尝试测试linux-image-extra-#{node['kernel']['release']}
将由我的食谱安装,并且我正在尝试#{node['kernel']['release']
使用 Fauxhai 进行模拟。到目前为止,我有;
describe 'my-cookbook::recipe' do
let(:chef_run) { ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '14.04').converge(described_recipe) }
before do
Fauxhai.mock(platform: 'ubuntu', version: '14.04') do |node|
node['kernel']['release'] = '3.13.0-66'
end
end
it 'installs linux extra image package do'
expect(chef_run).to install_package("linux-image-extra-#{node['kernel']['release']}-generic")
end
end
不幸的是,它没有获取该属性,并且正在产生一个显示此错误的错误;
失败/错误:expect(chef_run).to install_package("linux-image-extra-#{node['kernel']['release']}-generic")