chef/cookbooks/chef-sugar/spec/unit/chef/sugar/run_context_spec.rb
2023-06-28 16:35:56 +02:00

20 lines
554 B
Ruby

require 'spec_helper'
describe Chef::Sugar::RunContext do
it_behaves_like 'a chef sugar'
describe '#includes_recipe?' do
let(:node) { double(Chef::Node) }
it 'returns true when the recipe exists' do
allow(node).to receive(:recipe?).and_return(true)
expect(described_class.includes_recipe?(node, 'foo')).to be true
end
it 'returns false when the recipe does not exist' do
allow(node).to receive(:recipe?).and_return(false)
expect(described_class.includes_recipe?(node, 'bar')).to be false
end
end
end