summaryrefslogtreecommitdiffstats
path: root/test/lib/puppettest/fileparsing.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/lib/puppettest/fileparsing.rb')
-rw-r--r--test/lib/puppettest/fileparsing.rb34
1 files changed, 17 insertions, 17 deletions
diff --git a/test/lib/puppettest/fileparsing.rb b/test/lib/puppettest/fileparsing.rb
index 11de00220..914c4bcb3 100644
--- a/test/lib/puppettest/fileparsing.rb
+++ b/test/lib/puppettest/fileparsing.rb
@@ -1,26 +1,26 @@
module PuppetTest::FileParsing
- # Run an isomorphism test on our parsing process.
- def fakedataparse(*files)
- files.each do |file|
- @provider.stubs(:default_target).returns(file)
+ # Run an isomorphism test on our parsing process.
+ def fakedataparse(*files)
+ files.each do |file|
+ @provider.stubs(:default_target).returns(file)
- @provider.prefetch
+ @provider.prefetch
- text = @provider.to_file(@provider.target_records(file))
- text.gsub!(/^# HEADER.+\n/, '')
+ text = @provider.to_file(@provider.target_records(file))
+ text.gsub!(/^# HEADER.+\n/, '')
- yield if block_given?
+ 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
+ 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