Sha256: 20b26bfaa90f8738a8069d6f3e5ef98e04a227cacc840a1c1cbc91d87ebb5a8f
Contents?: true
Size: 862 Bytes
Versions: 16
Compression:
Stored size: 862 Bytes
Contents
module PuppetTest::FileParsing # Run an isomorphism test on our parsing process. def fakedataparse(*files) files.each do |file| @provider.stubs(:default_target).returns(file) @provider.prefetch text = @provider.to_file(@provider.target_records(file)) text.gsub!(/^# HEADER.+\n/, '') yield if block_given? oldlines = File.readlines(file) newlines = text.chomp.split "\n" oldlines.zip(newlines).each do |old, new| if self.is_a?(Test::Unit::TestCase) assert_equal(old.chomp.gsub(/\s+/, ''), new.gsub(/\s+/, ''), "File was not written back out correctly") else new.gsub(/\s+/, '').should == old.chomp.gsub(/\s+/, '') end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems