Skip to content

Instantly share code, notes, and snippets.

@harlanbarnes
Last active August 29, 2015 14:00
Show Gist options
  • Save harlanbarnes/11151382 to your computer and use it in GitHub Desktop.
Save harlanbarnes/11151382 to your computer and use it in GitHub Desktop.
Hack to work around cookbooks experiencing CHEF-4107
require 'spec_helper'
describe 'foo::default' do
let(:chef_run) do
ChefSpec::Runner.new do |node|
# Holy Hack - This bug: https://tickets.opscode.com/browse/CHEF-4107
# in the pleaserun cookbook (which is depended on by the logstash
# cookbook). As such, the rspec fails. So I'm cleaning them out before
# we converge
require 'find'
Find.find(node.runner.options[:cookbook_path]) do |path|
if File.directory?(path) and File.basename(path) == 'PaxHeader'
FileUtils.rm_rf(path)
end
end
end.converge(described_recipe)
end
it 'installs foo' do
expect(chef_run).to install_package('foo')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment