Project

General

Profile

« Previous | Next » 

Revision 4369422a

Added by Dominic Cleal almost 9 years ago

modulesync: add param docs lint check, add verify_* helpers

View differences:

spec/spec_helper.rb
class Undef
def inspect; 'undef'; end
end
def get_content(subject, 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)
end
def verify_concat_fragment_contents(subject, title, expected_lines)
content = subject.resource('concat::fragment', title).send(:parameters)[:content]
(content.split("\n") & expected_lines).should == expected_lines
end
def verify_concat_fragment_exact_contents(subject, title, expected_lines)
content = subject.resource('concat::fragment', title).send(:parameters)[:content]
content.split(/\n/).reject { |line| line =~ /(^#|^$|^\s+#)/ }.should == expected_lines
end

Also available in: Unified diff