Revision 8fbeb837
Added by Dominic Cleal over 8 years ago
Gemfile | ||
---|---|---|
gem 'rspec', '~> 3.0'
|
||
end
|
||
gem 'rake'
|
||
gem 'rspec-puppet', '~> 2.0'
|
||
gem 'rspec-puppet', '~> 2.3'
|
||
gem 'puppetlabs_spec_helper', '>= 0.8.0'
|
||
gem 'puppet-lint', '>= 1'
|
||
gem 'puppet-lint-unquoted_string-check'
|
spec/spec_helper.rb | ||
---|---|---|
content = subject.resource('concat::fragment', title).send(:parameters)[:content]
|
||
expect(content.split(/\n/).reject { |line| line =~ /(^#|^$|^\s+#)/ }).to eq(expected_lines)
|
||
end
|
||
|
||
# See https://github.com/rodjek/rspec-puppet/issues/329
|
||
# Without this patch the @@cache variable grows huge and causes memory usage issues
|
||
# with a large amount of examples.
|
||
module RSpec::Puppet
|
||
module Support
|
||
def build_catalog(*args)
|
||
if @@cache.has_key?(args)
|
||
@@cache[args]
|
||
else
|
||
@@cache = {}
|
||
@@cache[args] ||= self.build_catalog_without_cache(*args)
|
||
end
|
||
end
|
||
end
|
||
end
|
||
|
||
# See https://github.com/rodjek/rspec-puppet/pull/333
|
||
# Prevents each generated catalog being held in memory after the example group has
|
||
# completed.
|
||
RSpec.configure do |c|
|
||
c.after(:each) { @catalogue = nil }
|
||
end
|
Also available in: Unified diff
modulesync: update to rspec-puppet 2.3.0, remove workarounds