Project

General

Profile

« Previous | Next » 

Revision 113a881f

Added by Ewoud Kohl van Wijngaarden about 7 years ago

modulesync: Drop puppet 3, improve testing infra

View differences:

spec/spec_helper.rb
end
def get_content(subject, title)
is_expected.to contain_file(title)
content = subject.resource('file', title).send(:parameters)[:content]
content.split(/\n/).reject { |line| line =~ /(^#|^$|^\s+#)/ }
end
def verify_exact_contents(subject, title, expected_lines)
expect(get_content(subject, title)).to eq(expected_lines)
expect(get_content(subject, title)).to match_array(expected_lines)
end
def verify_concat_fragment_contents(subject, title, expected_lines)
is_expected.to contain_concat__fragment(title)
content = subject.resource('concat::fragment', title).send(:parameters)[:content]
expect(content.split("\n") & expected_lines).to eq(expected_lines)
expect(content.split("\n") & expected_lines).to match_array(expected_lines)
end
def verify_concat_fragment_exact_contents(subject, title, expected_lines)
is_expected.to contain_concat__fragment(title)
content = subject.resource('concat::fragment', title).send(:parameters)[:content]
expect(content.split(/\n/).reject { |line| line =~ /(^#|^$|^\s+#)/ }).to eq(expected_lines)
expect(content.split(/\n/).reject { |line| line =~ /(^#|^$|^\s+#)/ }).to match_array(expected_lines)
end

Also available in: Unified diff