diff options
Diffstat (limited to 'spec/support/helpers.rb')
-rw-r--r-- | spec/support/helpers.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index c17a92c3..e5774f12 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -349,5 +349,12 @@ module Spec ensure Dir[pattern].each(&chmod[0755, 0644]) end + + def process_file(pathname) + changed_lines = pathname.readlines.map do |line| + yield line + end + File.open(pathname, 'w') { |file| file.puts(changed_lines.join) } + end end end |