2012-01-19 18:58:37 -08:00
|
|
|
require 'puppet'
|
|
|
|
require 'rubygems'
|
|
|
|
require 'rspec-puppet'
|
|
|
|
|
|
|
|
def param_value(subject, type, title, param)
|
|
|
|
subject.resource(type, title).send(:parameters)[param.to_sym]
|
|
|
|
end
|
|
|
|
|
2012-04-21 12:54:17 -07:00
|
|
|
def verify_contents(subject, title, expected_lines)
|
|
|
|
content = subject.resource('file', title).send(:parameters)[:content]
|
|
|
|
(content.split("\n") & expected_lines).should == expected_lines
|
|
|
|
end
|
|
|
|
|
2012-01-19 18:58:37 -08:00
|
|
|
RSpec.configure do |c|
|
2012-02-27 16:44:45 -08:00
|
|
|
c.module_path = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures/modules'))
|
|
|
|
# Using an empty site.pp file to avoid: https://github.com/rodjek/rspec-puppet/issues/15
|
|
|
|
c.manifest_dir = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures/manifests'))
|
2012-01-19 18:58:37 -08:00
|
|
|
end
|