Skip to content

Instantly share code, notes, and snippets.

@ranjib
Created September 18, 2014 17:11
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ranjib/ba31fcab137c2ad23fc0 to your computer and use it in GitHub Desktop.
Save ranjib/ba31fcab137c2ad23fc0 to your computer and use it in GitHub Desktop.
Common Stubs
describe 'recipe[doit]' do
before(:each) do
stub_r3dparty_cookbooks
end
it 'some awesome specs do here' do
# assertion
end
end
require 'chefspec'
module CommonStubs
def stub_3dpraty_cookbooks
stub_command('sudo shutdown -h now')
end
end
RSpec.configure do |config|
config.include CommonStubs
config.before(:all) do
stub_3rdparty_cookbooks
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment