This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
let(:object) { Testing::Test.new } | |
let(:run_command) { stub(:stdout => 'Some string') } | |
let(:shellout) { stub(:run_command => run_command) } | |
it 'shells out' do | |
Mixlib::ShellOut.stub(:new).and_return(shellout) | |
expect(object.shellout).to eq('Some string') | |
end | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'chefspec' | |
module SpecHelper | |
def global_stubs | |
# Don't worry about external cookbook dependencies | |
Chef::Cookbook::Metadata.any_instance.stub(:depends) | |
# Test each recipe in isolation, regardless of includes | |
@included_recipes = [] | |
Chef::RunContext.any_instance.stub(:loaded_recipe?).and_return(false) |
NewerOlder